Sha256: 674542cf20b0c33b6f752ddef19d43b62396a64c44750f274f136ef95e62811b

Contents?: true

Size: 872 Bytes

Versions: 5

Compression:

Stored size: 872 Bytes

Contents

require "spec_helper"

describe TestNotifier::Stats, "TestUnit" do
  subject(:stats) { TestNotifier::Stats.new(:test_unit) }

  it "returns success message" do
    stats.options = { :count => 10, :assertions => 20 }
    expect(stats.message).to eql("10 tests, 20 assertions")
  end

  it "returns message with failing examples" do
    stats.options = { :count => 10, :assertions => 20, :failures => 5 }
    expect(stats.message).to eql("10 tests, 20 assertions, 5 failed")
  end

  it "message with error examples" do
    stats.options = { :count => 10, :assertions => 20, :errors => 5 }
    expect(stats.message).to eql("10 tests, 20 assertions, 5 errors")
  end

  it "message with all types" do
    stats.options = { :count => 6, :failures => 2, :errors => 3, :assertions => 20 }
    expect(stats.message).to eql("6 tests, 20 assertions, 2 failed, 3 errors")
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
test_notifier-2.0.3 spec/stats/test_unit_spec.rb
test_notifier-2.0.2 spec/stats/test_unit_spec.rb
test_notifier-2.0.1 spec/stats/test_unit_spec.rb
test_notifier-2.0.0 spec/stats/test_unit_spec.rb
test_notifier-1.0.1 spec/stats/test_unit_spec.rb