What I also like in RSpec is that it constructs a name for simplistics specifications, like:
context "Random number in 0..100 range" do
setup do
@random_number = rand(100)
end
specify do
@random_number.should < 100
end
specify do
@random_number.should >= 0
end
specify do
@random_number.should_not be_nil
end
end
Random number in 0..100 range - should < 100 - should >= 0 - should not be nil
Tiny addition that saves time and can force bad habits for larger specs :)
Michael what bad habits are you concerned about?
Of course, you don’t need to use that feature ;) But it is a feature that a LOT of people have wanted for a long time.
David,
that’s a really nice feature, and I like it. Although I’m trying to hack rspec to let it autogenerate proper names for more complex cases, like
David,
I know, count me in there. But for higher level testing that take place in Rails specification captions become a must. This is the only concern.
Michael – I’m not clear on what you mean. Can you give a specific example of where using an auto-generated description would cause confusion?
I’m not doubting you. I just don’t understand what you’re getting at.