search for: example_definitions

Displaying 1 result from an estimated 1 matches for "example_definitions".

Did you mean: example_definition
2007 Sep 21
11
given_it
...thinking about how cool would it be to re-use examples (just like we reuse story scenarios with GivenScenario). I was not sure if this possibility already exists in rspec (and, honestly, was lazy to check), so I have created this helper: def given_it(name) example_definition = behaviour.example_definitions.find{|i| i.description == name } instance_eval(&example_definition.example_block) end so it is possible to write things like it "should do something after another action" do given_it "should successfully do another action" do_something.should be_fine end Is the...