Sha256: 86ecfe908eae024867dd5a620f85c9bfeec9bc1927962e4f6e9db6a3502a2f69

Contents?: true

Size: 743 Bytes

Versions: 3

Compression:

Stored size: 743 Bytes

Contents

require 'nc_fail'

describe NcFail do
  let(:formatter) { NcFail.new(StringIO.new) }
  let(:notification) do
    instance_double(RSpec::Core::Notifications::SummaryNotification,
      formatted_duration: double,
      totals_line: double,
      failure_count: failure_count,
    )
  end

  context 'with failing examples' do
    let(:failure_count) { 1 }

    it 'sends a failure summary notification' do
      expect(TerminalNotifier).to receive(:notify)
      formatter.dump_summary(notification)
    end
  end

  context 'with all examples passing' do
    let(:failure_count) { 0 }

    it 'does not send a notification' do
      expect(TerminalNotifier).to_not receive(:notify)
      formatter.dump_summary(notification)
    end
  end
end

Version data entries

3 entries across 3 versions & 2 rubygems

Version Path
gameboard-3.1.0 vendor/bundle/ruby/2.3.0/gems/rspec-nc-0.3.0/spec/nc_fail_spec.rb
gameboard-3.0.0 vendor/bundle/ruby/2.3.0/gems/rspec-nc-0.3.0/spec/nc_fail_spec.rb
rspec-nc-0.3.0 spec/nc_fail_spec.rb