Sha256: b3ae91e4f01bd8e3b0fde2138f42ac387ad10f8ddf52a1a2f76ed3dcfff915d8

Contents?: true

Size: 877 Bytes

Versions: 1

Compression:

Stored size: 877 Bytes

Contents

# frozen_string_literal: true

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

1 entries across 1 versions & 1 rubygems

Version Path
test_notifier-2.1.0 spec/stats/test_unit_spec.rb