diff options
author | SHIBATA Hiroshi <hsbt@ruby-lang.org> | 2017-09-07 09:23:12 +0900 |
---|---|---|
committer | SHIBATA Hiroshi <hsbt@ruby-lang.org> | 2017-09-07 09:23:12 +0900 |
commit | 40aa4a6ffc3ec34db6dc2a1dea12d6833dfc75d8 (patch) | |
tree | 6183a7e75929be9290b52291fb282897fd264100 | |
parent | 30c255d16ea0221a263cbc203dd4f5db7ed25160 (diff) | |
download | bundler-40aa4a6ffc3ec34db6dc2a1dea12d6833dfc75d8.tar.gz |
Rename spec to spec_dir, bin to bindir on Spec::Path
-rw-r--r-- | spec/commands/exec_spec.rb | 4 | ||||
-rw-r--r-- | spec/commands/newgem_spec.rb | 2 | ||||
-rw-r--r-- | spec/spec_helper.rb | 2 | ||||
-rw-r--r-- | spec/support/helpers.rb | 8 | ||||
-rw-r--r-- | spec/support/path.rb | 8 |
5 files changed, 12 insertions, 12 deletions
diff --git a/spec/commands/exec_spec.rb b/spec/commands/exec_spec.rb index 3bd2273319..20b07e064b 100644 --- a/spec/commands/exec_spec.rb +++ b/spec/commands/exec_spec.rb @@ -61,7 +61,7 @@ RSpec.describe "bundle exec" do it "handles --keep-file-descriptors" do require "tempfile" - bundle_bin = File.expand_path("#{Spec::Path.bin}/bundle", __FILE__) + bundle_bin = File.expand_path("#{Spec::Path.bindir}/bundle", __FILE__) command = Tempfile.new("io-test") command.sync = true @@ -474,7 +474,7 @@ RSpec.describe "bundle exec" do Bundler.rubygems.extend(Monkey) G bundle "install --deployment" - bundle "exec ruby -e '`#{Spec::Path.bin}/bundler -v`; puts $?.success?'" + bundle "exec ruby -e '`#{Spec::Path.bindir}/bundler -v`; puts $?.success?'" expect(out).to match("true") end end diff --git a/spec/commands/newgem_spec.rb b/spec/commands/newgem_spec.rb index ce01fcfb87..f9420e46dd 100644 --- a/spec/commands/newgem_spec.rb +++ b/spec/commands/newgem_spec.rb @@ -170,7 +170,7 @@ RSpec.describe "bundle gem" do # This spec cannot have `git` available in the test env before do - bundle_bin = File.expand_path("#{Spec::Path.bin}/bundle", __FILE__) + bundle_bin = File.expand_path("#{Spec::Path.bindir}/bundle", __FILE__) load_paths = [lib, spec] load_path_str = "-I#{load_paths.join(File::PATH_SEPARATOR)}" diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index 85821546bc..bff034688c 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -47,7 +47,7 @@ $debug = false Spec::Manpages.setup Spec::Rubygems.setup FileUtils.rm_rf(Spec::Path.gem_repo1) -ENV["RUBYOPT"] = "#{ENV["RUBYOPT"]} -r#{Spec::Path.spec}/support/hax.rb" +ENV["RUBYOPT"] = "#{ENV["RUBYOPT"]} -r#{Spec::Path.spec_dir}/support/hax.rb" ENV["BUNDLE_SPEC_RUN"] = "true" # Don't wrap output in tests diff --git a/spec/support/helpers.rb b/spec/support/helpers.rb index db37609f1f..a72db2756b 100644 --- a/spec/support/helpers.rb +++ b/spec/support/helpers.rb @@ -94,7 +94,7 @@ module Spec end def spec - File.expand_path(Spec::Path.spec.to_s, __FILE__) + File.expand_path(Spec::Path.spec_dir.to_s, __FILE__) end def bundle(cmd, options = {}) @@ -104,7 +104,7 @@ module Spec no_color = options.delete("no-color") { cmd.to_s !~ /\A(e|ex|exe|exec|conf|confi|config)(\s|\z)/ } options["no-color"] = true if no_color - bundle_bin = options.delete("bundle_bin") || File.expand_path("#{Spec::Path.bin}/bundle", __FILE__) + bundle_bin = options.delete("bundle_bin") || File.expand_path("#{Spec::Path.bindir}/bundle", __FILE__) if system_bundler = options.delete(:system_bundler) bundle_bin = "-S bundle" @@ -173,12 +173,12 @@ module Spec end def bundler(cmd, options = {}) - options["bundle_bin"] = File.expand_path("#{Spec::Path.bin}/bundler", __FILE__) + options["bundle_bin"] = File.expand_path("#{Spec::Path.bindir}/bundler", __FILE__) bundle(cmd, options) end def bundle_ruby(options = {}) - options["bundle_bin"] = File.expand_path("#{Spec::Path.bin}/bundle_ruby", __FILE__) + options["bundle_bin"] = File.expand_path("#{Spec::Path.bindir}/bundle_ruby", __FILE__) bundle("", options) end diff --git a/spec/support/path.rb b/spec/support/path.rb index f748b11105..b24ac16d5b 100644 --- a/spec/support/path.rb +++ b/spec/support/path.rb @@ -12,12 +12,12 @@ module Spec @gemspec ||= Pathname.new(File.expand_path(root.join("bundler.gemspec"), __FILE__)) end - def bin - @bin ||= Pathname.new(File.expand_path(root.join("exe"), __FILE__)) + def bindir + @bindir ||= Pathname.new(File.expand_path(root.join("exe"), __FILE__)) end - def spec - @spec ||= Pathname.new(File.expand_path(root.join("spec"), __FILE__)) + def spec_dir + @spec_dir ||= Pathname.new(File.expand_path(root.join("spec"), __FILE__)) end def tmp(*path) |