Sha256: d74f36ddbb5470f81791faa3020d973f7708f5534e8ef27ad1ef871098015911

Contents?: true

Size: 593 Bytes

Versions: 5

Compression:

Stored size: 593 Bytes

Contents

require 'test_helper'

module Pelusa
  describe Cli do
    describe "#run" do
      before do
        @report = stub(empty?: false, report: true, class: Reporter)
        Pelusa.stubs(:run).returns [@report]
      end
      describe 'when the reports are successful' do
        it 'returns 0' do
          @report.stubs(successful?: true)
          Cli.new.run().must_equal 0
        end
      end
      describe 'when the reports have failed' do
        it 'returns 1' do
          @report.stubs(successful?: false)
          Cli.new.run().must_equal 1
        end
      end
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
pelusa-0.2.4 test/pelusa/cli_test.rb
pelusa-0.2.3 test/pelusa/cli_test.rb
pelusa-0.2.2 test/pelusa/cli_test.rb
pelusa-0.2.1 test/pelusa/cli_test.rb
pelusa-0.2.0 test/pelusa/cli_test.rb