spec/rake/funnel/integration/teamcity/teamcity_spec.rb in rake-funnel-0.18.0 vs spec/rake/funnel/integration/teamcity/teamcity_spec.rb in rake-funnel-0.19.0
- old
+ new
@@ -1,10 +1,12 @@
+# rubocop:disable RSpec/FilePath
+
describe Rake::Funnel::Integration::TeamCity do
describe 'runner detection' do
- before {
+ before do
allow(ENV).to receive(:include?).with(described_class::PROJECT_ENV_VAR).and_return(teamcity_running?)
- }
+ end
context 'when running outside TeamCity' do
let(:teamcity_running?) { false }
it 'should not detect TeamCity' do
@@ -36,18 +38,18 @@
describe '#with_java_runtime' do
let(:original_path) { 'original path environment variable contents' }
let(:jre) { nil }
- before {
+ before do
allow(ENV).to receive(:[]=)
allow(ENV).to receive(:[]).with('PATH').and_return(original_path)
allow(ENV).to receive(:include?).with(described_class::JRE_ENV_VAR).and_return(!jre.nil?)
allow(ENV).to receive(:[]).with(described_class::JRE_ENV_VAR).and_return(jre)
- }
+ end
context 'without block' do
it 'should not modify environment variables' do
described_class.with_java_runtime
@@ -89,10 +91,10 @@
expect(ENV).to have_received(:[]=).with('PATH', original_path)
end
context 'block error' do
it 'should reset path' do
- expect { described_class.with_java_runtime { fail 'with some error' } }.to raise_error(/with some error/)
+ expect { described_class.with_java_runtime { raise 'with some error' } }.to raise_error(/with some error/)
expect(ENV).to have_received(:[]=).with('PATH', original_path)
end
end
end