summaryrefslogtreecommitdiff
path: root/spec/commands/init_spec.rb
diff options
context:
space:
mode:
Diffstat (limited to 'spec/commands/init_spec.rb')
-rw-r--r--spec/commands/init_spec.rb12
1 files changed, 3 insertions, 9 deletions
diff --git a/spec/commands/init_spec.rb b/spec/commands/init_spec.rb
index 1fb83827c2..ed52187115 100644
--- a/spec/commands/init_spec.rb
+++ b/spec/commands/init_spec.rb
@@ -32,9 +32,7 @@ RSpec.describe "bundle init" do
FileUtils.mkdir bundled_app(subdir)
- Dir.chdir bundled_app(subdir) do
- bundle! :init
- end
+ bundle! :init, :dir => bundled_app(subdir)
expect(out).to include("Writing new Gemfile")
expect(bundled_app("#{subdir}/Gemfile")).to be_file
@@ -50,9 +48,7 @@ RSpec.describe "bundle init" do
mode = File.stat(bundled_app(subdir)).mode ^ 0o222
FileUtils.chmod mode, bundled_app(subdir)
- Dir.chdir bundled_app(subdir) do
- bundle :init
- end
+ bundle :init, :dir => bundled_app(subdir)
expect(err).to include("directory is not writable")
expect(Dir[bundled_app("#{subdir}/*")]).to be_empty
@@ -133,9 +129,7 @@ RSpec.describe "bundle init" do
FileUtils.mkdir bundled_app(subdir)
- Dir.chdir bundled_app(subdir) do
- bundle! :init
- end
+ bundle! :init, :dir => bundled_app(subdir)
expect(out).to include("Writing new gems.rb")
expect(bundled_app("#{subdir}/gems.rb")).to be_file