0
describe "where ExampleGroup has no superclasss with a description" do
0
-
formatter.add_example_group(example_group)0
- it "should produce standard summary without pending when pending has a 0 count" do
0
- formatter.dump_summary(3, 2, 1, 0)
0
- io.string.should have_example_group_output("\nFinished in 3 seconds\n\n2 examples, 1 failure\n")
0
+ formatter.add_example_group(example_group)
0
- it "should produce standard summary" do
0
- formatter.dump_summary(3, 2, 1, 4)
0
- io.string.should have_example_group_output("\nFinished in 3 seconds\n\n2 examples, 1 failure, 4 pending\n")
0
+ describe "#dump_summary" do
0
+ it "should produce standard summary without pending when pending has a 0 count" do
0
+ formatter.dump_summary(3, 2, 1, 0)
0
+ io.string.should have_example_group_output("\nFinished in 3 seconds\n\n2 examples, 1 failure\n")
0
- it "should push ExampleGroup name" do
0
- io.string.should eql("\nExampleGroup\n")
0
+ it "should produce standard summary" do
0
+ formatter.dump_summary(3, 2, 1, 4)
0
+ io.string.should have_example_group_output("\nFinished in 3 seconds\n\n2 examples, 1 failure, 4 pending\n")
0
- it "when having an error, should push failing spec name and failure number" do
0
- formatter.example_failed(
0
- example_group.it("spec"),
0
- Reporter::Failure.new("c s", RuntimeError.new)
0
- io.string.should have_example_group_output("- spec (ERROR - 98)\n")
0
+ describe "#add_example_group" do
0
+ it "should push ExampleGroup name" do
0
+ io.string.should eql("\nExampleGroup\n")
0
- it "when having an expectation failure, should push failing spec name and failure number" do
0
- formatter.example_failed(
0
- example_group.it("spec"),
0
- Reporter::Failure.new("c s", Spec::Expectations::ExpectationNotMetError.new)
0
- io.string.should have_example_group_output("- spec (FAILED - 98)\n")
0
+ describe "#example_failed" do
0
+ describe "where ExampleGroup has no superclasss with a description" do
0
+ describe "when having an error" do
0
+ it "should push failing spec name and failure number" do
0
+ formatter.example_failed(
0
+ example_group.it("spec"),
0
+ Reporter::Failure.new("c s", RuntimeError.new)
0
+ io.string.should have_example_group_output("- spec (ERROR - 98)\n")
0
- it "should push nothing on start" do
0
- io.string.should have_example_group_output("")
0
+ describe "when having an expectation failure" do
0
+ it "should push failing spec name and failure number" do
0
+ formatter.example_failed(
0
+ example_group.it("spec"),
0
+ Reporter::Failure.new("c s", Spec::Expectations::ExpectationNotMetError.new)
0
+ io.string.should have_example_group_output("- spec (FAILED - 98)\n")
0
- it "should push nothing on start dump" do
0
- io.string.should have_example_group_output("")
0
+ describe "where ExampleGroup has two superclasses with a description" do
0
+ attr_reader :child_example_group, :grand_child_example_group
0
+ @child_example_group = Class.new(example_group).describe("Child ExampleGroup")
0
+ @grand_child_example_group = Class.new(child_example_group).describe("GrandChild ExampleGroup")
0
+ formatter.add_example_group(grand_child_example_group)
0
- it "should push passing spec name" do
0
- formatter.example_passed(example_group.it("spec"))
0
- io.string.should have_example_group_output("- spec\n")
0
+ describe "when having an error" do
0
+ it "should push failing spec name and failure number" do
0
+ formatter.example_failed(
0
+ example_group.it("spec"),
0
+ Reporter::Failure.new("c s", RuntimeError.new)
0
+ io.string.should have_nested_example_group_output("- spec (ERROR - 98)\n")
0
- it "should push pending example name and message" do
0
- formatter.example_pending(example_group.examples.first, 'reason')
0
- io.string.should have_example_group_output("- example (PENDING: reason)\n")
0
+ describe "when having an expectation" do
0
+ it "should push failing spec name and failure number" do
0
+ formatter.example_failed(
0
+ example_group.it("spec"),
0
+ Reporter::Failure.new("c s", Spec::Expectations::ExpectationNotMetError.new)
0
+ io.string.should have_nested_example_group_output("- spec (FAILED - 98)\n")
0
- it "should dump pending" do
0
- formatter.example_pending(example_group.examples.first, 'reason')
0
- formatter.dump_pending
0
- io.string.should =~ /Pending\:\nExampleGroup example \(reason\)\n/
0
+ def have_nested_example_group_output(expected_output)
0
+ expected_full_output = "\nExampleGroup Child ExampleGroup GrandChild ExampleGroup\n#{expected_output}"
0
+ ::Spec::Matchers::SimpleMatcher.new(expected_full_output) do |actual|
0
+ actual == expected_full_output
0
- def have_example_group_output(expected_output)
0
- expected = "\nExampleGroup\n#{expected_output}"
0
- ::Spec::Matchers::SimpleMatcher.new(expected) do |actual|
0
+ it "should push nothing on start" do
0
+ io.string.should have_example_group_output("")
0
- describe "where ExampleGroup has two superclasses with a description" do
0
- attr_reader :child_example_group, :grand_child_example_group
0
- @child_example_group = Class.new(example_group).describe("Child ExampleGroup")
0
- @grand_child_example_group = Class.new(child_example_group).describe("GrandChild ExampleGroup")
0
- formatter.add_example_group(grand_child_example_group)
0
+ describe "#start_dump" do
0
+ it "should push nothing on start dump" do
0
+ io.string.should have_example_group_output("")
0
- specify "when having an error, should push failing spec name and failure number" do
0
- formatter.example_failed(
0
- example_group.it("spec"),
0
- Reporter::Failure.new("c s", RuntimeError.new)
0
- io.string.should have_nested_example_group_output("- spec (ERROR - 98)\n")
0
+ describe "#example_passed" do
0
+ it "should push passing spec name" do
0
+ formatter.example_passed(example_group.it("spec"))
0
+ io.string.should have_example_group_output("- spec\n")
0
- specify "when having an expectation failure, should push failing spec name and failure number" do
0
- formatter.example_failed(
0
- example_group.it("spec"),
0
- Reporter::Failure.new("c s", Spec::Expectations::ExpectationNotMetError.new)
0
- io.string.should have_nested_example_group_output("- spec (FAILED - 98)\n")
0
+ describe "#example_pending" do
0
+ it "should push pending example name and message" do
0
+ formatter.example_pending(example_group.examples.first, 'reason')
0
+ io.string.should have_example_group_output("- example (PENDING: reason)\n")
0
+ it "should dump pending" do
0
+ formatter.example_pending(example_group.examples.first, 'reason')
0
+ formatter.dump_pending
0
+ io.string.should =~ /Pending\:\nExampleGroup example \(reason\)\n/
0
- def have_nested_example_group_output(expected_output)
0
- expected_full_output = "\nExampleGroup Child ExampleGroup GrandChild ExampleGroup\n#{expected_output}"
0
- ::Spec::Matchers::SimpleMatcher.new(expected_full_output) do |actual|
0
- actual == expected_full_output
0
+ def have_example_group_output(expected_output)
0
+ expected = "\nExampleGroup\n#{expected_output}"
0
+ ::Spec::Matchers::SimpleMatcher.new(expected) do |actual|
Comments
This is pretty sweet. Thanks Brian.