-
Notifications
You must be signed in to change notification settings - Fork 61
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
And doesn't give good output #31
Comments
Then blocks are essentially translated into RSpec "it" blocks. Each block runs independently of the other blocks and is not effected by the success and failure of any other block. Using: Then { a.should == b }
And { c.should == d } is essentially equivalent to: it "..." do
a.should == b
c.should == d
end in order to take advantage of the common setup. However, the downside is that the first assertion to fail causes any following assertions to not be run. This is pretty fundamental to the structure of RSpec and I'm not aware of any easy way around this without delving deep into RSpec internals. However, I'd be interested hearing possible solutions or patches in this area. |
Hey @searls -- in case it's useful: In rspec/rspec-core#756, @tovodeverett posted code for a before(:each) { some_time_consuming_setup }
nullipotent_tests do
it { should be_kind_of(SomeClass) }
it { should == foo }
. . .
end but still pass/fail/report as separate tests. He originally did it for rspec 2, and recently updated it for rspec 3. Maybe his approach could be used to translate Then { a.should == b }
And { c.should == d } into the equivalent of nullipotent_tests do
it { a.should == b }
it { c.should == d }
end I haven't grokked how either |
Opened this as an issue in the new repo: rspec-given#4 |
When you use Then,Then,Then
You get an output line that is either red or green for each one.
When you use Then,And,And, you only get output for the first line, with the whole test succeeding or failing. You get more detail later on, but it'd be nice to have fast tests and verbose output for each test.
Should And spit out a red/green pass status? (asking before I attempt to submit a patch that would be rejected.) Is there a good reason that it doesn't do this already?
The text was updated successfully, but these errors were encountered: