Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Omitted tests should be reported as <skipped> #11

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions acceptance/test_unit_example_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,7 @@ class TestUnitExampleTestTwo < Test::Unit::TestCase
def test_two
assert true
end
def test_three
omit 'omitted'
end
end
7 changes: 6 additions & 1 deletion acceptance/verification_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,16 @@

it { is_expected.to have(0).errors }
it { is_expected.to have(0).failures }
it { is_expected.to have(1).testcases }
it { is_expected.to have(2).testcases }

describe "the assertion count" do
subject { result.assertions_count }
it { is_expected.to eql 1 }
end

describe "the skipped count" do
subject { result.skipped_count}
it { is_expected.to eql 1 }
end

it_behaves_like "a report with consistent attribute counts"
Expand Down
8 changes: 7 additions & 1 deletion lib/ci/reporter/test_unit.rb
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ class TestUnitError
def initialize(fault) @fault = fault end
def failure?() false end
def error?() true end
def skipped?() false end
def name() @fault.exception.class.name end
def message() @fault.exception.message end
def location() @fault.exception.backtrace.join("\n") end
Expand All @@ -41,6 +42,7 @@ class TestUnitFailure
def initialize(fault) @fault = fault end
def failure?() true end
def error?() false end
def skipped?() false end
def name() Test::Unit::AssertionFailedError.name end
def message() @fault.message end
def location() @fault.location.join("\n") end
Expand All @@ -51,6 +53,7 @@ class TestUnitSkipped
def initialize(fault) @fault = fault end
def failure?() false end
def error?() false end
def skipped?() true end
def name() @fault.class.name end
def message() @fault.message end
def location() @fault.location.join("\n") end
Expand All @@ -61,6 +64,7 @@ class TestUnitNotification
def initialize(fault) @fault = fault end
def failure?() false end
def error?() false end
def skipped?() false end
def name() @fault.class.name end
def message() @fault.message end
def location() @fault.location.join("\n") end
Expand Down Expand Up @@ -103,7 +107,9 @@ def test_finished(name)

def fault(fault)
tc = @current_suite.testcases.last
tc.failures << Failure.new(fault)
f = Failure.new(fault)
tc.failures << f
tc.skipped=true if f.skipped?
end

def finished(elapsed_time)
Expand Down