Skip to content

Commit

Permalink
Show tagged stats by default.
Browse files Browse the repository at this point in the history
  • Loading branch information
nirvdrum authored and eregon committed Mar 24, 2015
1 parent 3ac8bc4 commit 6676cd6
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 12 deletions.
3 changes: 1 addition & 2 deletions lib/mspec/runner/actions/tally.rb
Expand Up @@ -62,10 +62,9 @@ def tag
end

def format
results = [ file, example, expectation, failure, error ]
results = [ file, example, expectation, failure, error, tag ]
if [:report, :report_on, :verify].any? { |m| MSpec.mode? m }
results << guard
results << tag
end
results.join(", ")
end
Expand Down
4 changes: 2 additions & 2 deletions spec/commands/mspec_spec.rb
Expand Up @@ -143,7 +143,7 @@
Finished in 42 seconds
2 files, 2 examples, 4 expectations, 0 failures, 0 errors
2 files, 2 examples, 4 expectations, 0 failures, 0 errors, 0 tagged
]
end

Expand Down Expand Up @@ -174,7 +174,7 @@
Finished in 42 seconds
1 file, 1 example, 2 expectations, 0 failures, 0 errors
1 file, 1 example, 2 expectations, 0 failures, 0 errors, 0 tagged
]
end
end
Expand Down
13 changes: 8 additions & 5 deletions spec/runner/actions/tally_spec.rb
Expand Up @@ -180,7 +180,8 @@
@tally.examples! 2
@tally.expectations! 4
@tally.errors!
@tally.format.should == "1 file, 2 examples, 4 expectations, 0 failures, 1 error"
@tally.tagged!
@tally.format.should == "1 file, 2 examples, 4 expectations, 0 failures, 1 error, 1 tagged"
end

it "includes guards if MSpec is in verify mode" do
Expand All @@ -189,9 +190,10 @@
@tally.examples! 2
@tally.expectations! 4
@tally.errors!
@tally.tagged!
@tally.guards!
@tally.format.should ==
"1 file, 2 examples, 4 expectations, 0 failures, 1 error, 1 guard, 0 tagged"
"1 file, 2 examples, 4 expectations, 0 failures, 1 error, 1 tagged, 1 guard"
end

it "includes guards if MSpec is in report mode" do
Expand All @@ -200,9 +202,10 @@
@tally.examples! 2
@tally.expectations! 4
@tally.errors!
@tally.tagged!
@tally.guards! 2
@tally.format.should ==
"1 file, 2 examples, 4 expectations, 0 failures, 1 error, 2 guards, 0 tagged"
"1 file, 2 examples, 4 expectations, 0 failures, 1 error, 1 tagged, 2 guards"
end

it "includes guards if MSpec is in report_on mode" do
Expand All @@ -213,7 +216,7 @@
@tally.errors!
@tally.guards! 2
@tally.format.should ==
"1 file, 2 examples, 4 expectations, 0 failures, 1 error, 2 guards, 0 tagged"
"1 file, 2 examples, 4 expectations, 0 failures, 1 error, 0 tagged, 2 guards"
end
end

Expand Down Expand Up @@ -312,7 +315,7 @@
@tally.expectation @state
exc = ExceptionState.new nil, nil, SpecExpectationNotMetError.new("Failed!")
@tally.exception exc
@tally.format.should == "1 file, 1 example, 2 expectations, 1 failure, 0 errors"
@tally.format.should == "1 file, 1 example, 2 expectations, 1 failure, 0 errors, 0 tagged"
end
end

Expand Down
6 changes: 3 additions & 3 deletions spec/runner/formatters/describe_spec.rb
Expand Up @@ -37,7 +37,7 @@

it "prints a tally of counts" do
@formatter.finish
@out.should =~ /^1 file, 1 example, 2 expectations, 0 failures, 0 errors$/
@out.should =~ /^1 file, 1 example, 2 expectations, 0 failures, 0 errors, 0 tagged$/
end

it "does not print exceptions" do
Expand All @@ -46,7 +46,7 @@
Finished in 2.0 seconds
1 file, 1 example, 2 expectations, 0 failures, 0 errors
1 file, 1 example, 2 expectations, 0 failures, 0 errors, 0 tagged
]
end

Expand All @@ -61,7 +61,7 @@
Finished in 2.0 seconds
1 file, 1 example, 2 expectations, 0 failures, 0 errors
1 file, 1 example, 2 expectations, 0 failures, 0 errors, 0 tagged
]
end
end

0 comments on commit 6676cd6

Please sign in to comment.