Sha256: 4cd44ab88fdd002b155d6f2e9d0f7fe2dcfe2eb4b8f6965828657652023f8d2b

Contents?: true

Size: 642 Bytes

Versions: 4

Compression:

Stored size: 642 Bytes

Contents

require 'test_helper'

module Pelusa
  describe Runner do
    describe '#run' do
      before do
        @report = stub(empty?: false, report: true)
        analyzer = stub(:analyze => @report)
        Analyzer.stubs(:new).returns analyzer
      end

      describe 'when the reports are successful' do
        it 'returns 0' do
          @report.stubs(successful?: true)
          Pelusa.run(__FILE__).must_equal 0
        end
      end

      describe 'when the reports have failed' do
        it 'returns 1' do
          @report.stubs(successful?: false)
          Pelusa.run(__FILE__).must_equal 1
        end
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
pelusa-0.1.1 test/pelusa/runner_test.rb
pelusa-0.1.0 test/pelusa/runner_test.rb
pelusa-0.0.2 test/pelusa/runner_test.rb
pelusa-0.0.1 test/pelusa/runner_test.rb