diff options
Diffstat (limited to 'spec/bundler/env_spec.rb')
-rw-r--r-- | spec/bundler/env_spec.rb | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/spec/bundler/env_spec.rb b/spec/bundler/env_spec.rb index 5e588a6042..8ff5ddada6 100644 --- a/spec/bundler/env_spec.rb +++ b/spec/bundler/env_spec.rb @@ -86,6 +86,8 @@ RSpec.describe Bundler::Env do BUNDLED WITH 1.10.0 L + + allow(Bundler::SharedHelpers).to receive(:find_gemfile).and_return(bundled_app_gemfile) end let(:output) { described_class.report(:print_gemfile => true) } @@ -125,6 +127,8 @@ RSpec.describe Bundler::Env do File.open(bundled_app.join("foo.gemspec"), "wb") do |f| f.write(gemspec) end + + allow(Bundler::SharedHelpers).to receive(:find_gemfile).and_return(bundled_app_gemfile) end it "prints the gemspec" do @@ -137,13 +141,15 @@ RSpec.describe Bundler::Env do context "when eval_gemfile is used" do it "prints all gemfiles" do - create_file "other/Gemfile-other", "gem 'rack'" - create_file "other/Gemfile", "eval_gemfile 'Gemfile-other'" - create_file "Gemfile-alt", <<-G + create_file bundled_app("other/Gemfile-other"), "gem 'rack'" + create_file bundled_app("other/Gemfile"), "eval_gemfile 'Gemfile-other'" + create_file bundled_app("Gemfile-alt"), <<-G source "#{file_uri_for(gem_repo1)}" eval_gemfile "other/Gemfile" G - gemfile "eval_gemfile #{File.expand_path("Gemfile-alt").dump}" + gemfile "eval_gemfile #{bundled_app("Gemfile-alt").to_s.dump}" + allow(Bundler::SharedHelpers).to receive(:find_gemfile).and_return(bundled_app_gemfile) + allow(Bundler::SharedHelpers).to receive(:pwd).and_return(bundled_app) output = described_class.report(:print_gemspecs => true) expect(output).to include(strip_whitespace(<<-ENV)) @@ -152,7 +158,7 @@ RSpec.describe Bundler::Env do ### Gemfile ```ruby - eval_gemfile #{File.expand_path("Gemfile-alt").dump} + eval_gemfile #{bundled_app("Gemfile-alt").to_s.dump} ``` ### Gemfile-alt @@ -177,7 +183,7 @@ RSpec.describe Bundler::Env do ### Gemfile.lock ``` - <No #{bundled_app("Gemfile.lock")} found> + <No #{bundled_app_lock} found> ``` ENV end |