Sha256: 5bb59fd657840534531b8a4e94a93109541b160bdc4713eeb9bb23e2dc6b0f1c
Contents?: true
Size: 1.19 KB
Versions: 16
Compression:
Stored size: 1.19 KB
Contents
require 'spec_helper' describe CodeClimate::TestReporter do let(:reporter) { CodeClimate::TestReporter.dup } describe '.run_on_current_branch?' do it 'returns true if there is no branch configured' do allow(reporter).to receive(:configured_branch).and_return(nil) expect(reporter).to be_run_on_current_branch end it 'returns true if the current branch matches the configured branch' do allow(reporter).to receive(:current_branch).and_return("master\n") allow(reporter).to receive(:configured_branch).and_return(:master) expect(reporter).to be_run_on_current_branch end it 'returns false if the current branch and configured branch dont match' do allow(reporter).to receive(:current_branch).and_return("some-branch") allow(reporter).to receive(:configured_branch).and_return(:master) expect(reporter).to_not be_run_on_current_branch end it 'logs a message if false' do expect_any_instance_of(Logger).to receive(:info) allow(reporter).to receive(:current_branch).and_return("another-branch") allow(reporter).to receive(:configured_branch).and_return(:master) reporter.run_on_current_branch? end end end
Version data entries
16 entries across 14 versions & 3 rubygems