test/context_test.rb in riot-0.10.10 vs test/context_test.rb in riot-0.10.11

- old
+ new

@@ -85,6 +85,26 @@ should("return the actual topic as the result of evaling the assertion") do (situation = Riot::Situation.new).topic = "bar" topic.equals("bar").run(situation) end.equals([:pass, %Q{is equal to "bar"}]) + + asserts(:to_s).equals("asserts topic") + + context "with an explicit description" do + setup { Riot::Context.new("foo") {}.asserts_topic("get some") } + asserts(:to_s).equals("asserts get some") + end + end # The asserts_topic shortcut + +context "Using a hookup" do + setup do + situation = Riot::Situation.new + a_context = Riot::Context.new("foobar") {} + a_context.setup { "I'm a string" }.run(situation) + a_context.hookup { topic.size }.run(situation) + situation.topic + end + + asserts_topic.equals("I'm a string") +end # Using a hookup