Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add it blocks #34

Closed
wants to merge 1 commit into from
Closed

Add it blocks #34

wants to merge 1 commit into from

Conversation

locochris
Copy link
Collaborator

Don't know if anyone will think this sugar is sweet enough, but ...

Instead of writing:

it "assert equal $((1+1)) 2"
  assert equals $((1+1)) 2

write:

it <<-'EOF'
  assert equal $((1+1)) 2
EOF

Instead of writing:
```bash
it "assert equal $((1+1)) 2"
  assert equals $((1+1)) 2
```

write:
```bash
it <<-'EOF'
  assert equal $((1+1)) 2
EOF
```
@rylnd
Copy link
Owner

rylnd commented Mar 8, 2013

My feeling is there are few cases in which this would be useful, since it requires a single-line, self-explanatory assertion.

Besides the possible addition of an end_it command, I think we've probably hit a wall with how far we can push the current syntax.

I'd like to eventually replace the end_it and end_describe with something like the { } that's used in bats. It would require a preprocessor, but I think that could solve a lot of the issues we currently have open.

@twe4ked
Copy link
Contributor

twe4ked commented Mar 8, 2013

@rylnd I had a quick look at how the bats DSL works and that looks perfect.

This would potentially help solve #15, #30 and #31.

@locochris
Copy link
Collaborator Author

-1 for the bats preprocessor pattern, or at least be very careful it doesn't cause more problems than it solves.

I had problems with that exact thing in bats which led me to shpec in the first place.
I think it was when I was trying to put shpecs in a loop, and/or trying to output anything other than a shpec result.
(Although that might have been because of its use of the TAP.)

(My shpecs currently have verbose output that are summarized by a shpec result and can be in loops.)

@rylnd rylnd closed this Aug 2, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants