test/report_test.rb in riot-0.10.9 vs test/report_test.rb in riot-0.10.10

- old
+ new

@@ -1,11 +1,11 @@ require 'teststrap' context "A reporter" do setup do Class.new(Riot::Reporter) do - def pass(d) "passed(#{d})"; end + def pass(d, message) "passed(#{d}, #{message.inspect})"; end def fail(d, message) "failed(#{d}, #{message})"; end def error(d, e) "errored(#{d}, #{e})"; end end.new end @@ -16,11 +16,11 @@ topic.passes end.equals(1) asserts("description sent to #pass") do topic.report("hi mom", [:pass]) - end.equals("passed(hi mom)") + end.equals("passed(hi mom, nil)") # fail asserts("fail count increase when :fail sent to #report") do topic.report("", [:fail, ""]) @@ -53,9 +53,14 @@ context "StoryReporter" do setup do @out = StringIO.new Riot::StoryReporter.new(@out) end + + asserts("success message is stripped if nil") do + topic.pass("foo", nil) + ColorHelper.uncolored(@out.string) + end.equals(" + foo\n") context 'reporting on an empty context' do setup do context = Riot::Context.new('empty context') do context("a nested empty context") {}