test/report_test.rb in riot-0.10.10 vs test/report_test.rb in riot-0.10.11
- old
+ new
@@ -4,10 +4,11 @@
setup do
Class.new(Riot::Reporter) do
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
+ def results(time); end
end.new
end
# pass
@@ -42,11 +43,25 @@
topic.report("break it down", [:error, "error time"])
end.equals("errored(break it down, error time)")
context "instance" do
setup { Riot::Reporter.new }
-
should("return self invoking new") { topic.new }.equals { topic }
+ end
+
+ context "with no errors or failures" do
+ hookup { topic.report("foo", [:pass, nil]) }
+ asserts(:success?)
+ end
+
+ context "with failures and no errors" do
+ hookup { topic.report("foo", [:fail, "blah"]) }
+ asserts(:success?).equals(false)
+ end
+
+ context "with errors and no failures" do
+ hookup { topic.report("foo", [:error, Exception.new("boogers")]) }
+ asserts(:success?).equals(false)
end
end # A reporter
require 'stringio'
context "StoryReporter" do