diff options
Diffstat (limited to 'spec')
-rw-r--r-- | spec/bundler/dsl_spec.rb | 10 | ||||
-rw-r--r-- | spec/bundler/fetcher_spec.rb | 4 | ||||
-rw-r--r-- | spec/bundler/gem_helper_spec.rb | 4 | ||||
-rw-r--r-- | spec/cache/git_spec.rb | 2 | ||||
-rw-r--r-- | spec/commands/outdated_spec.rb | 2 | ||||
-rw-r--r-- | spec/commands/show_spec.rb | 2 | ||||
-rw-r--r-- | spec/install/post_bundle_message_spec.rb | 10 | ||||
-rw-r--r-- | spec/runtime/gem_tasks_spec.rb | 2 | ||||
-rw-r--r-- | spec/runtime/inline_spec.rb | 2 | ||||
-rw-r--r-- | spec/spec_helper.rb | 2 | ||||
-rw-r--r-- | spec/support/builders.rb | 4 | ||||
-rw-r--r-- | spec/support/helpers.rb | 12 | ||||
-rw-r--r-- | spec/support/indexes.rb | 2 | ||||
-rw-r--r-- | spec/support/matchers.rb | 4 | ||||
-rw-r--r-- | spec/support/platforms.rb | 4 | ||||
-rw-r--r-- | spec/support/streams.rb | 4 |
16 files changed, 35 insertions, 35 deletions
diff --git a/spec/bundler/dsl_spec.rb b/spec/bundler/dsl_spec.rb index 686e1f9449..869e5a8c5e 100644 --- a/spec/bundler/dsl_spec.rb +++ b/spec/bundler/dsl_spec.rb @@ -8,8 +8,8 @@ describe Bundler::Dsl do describe "#git_source" do it "registers custom hosts" do - subject.git_source(:example){ |repo_name| "git@git.example.com:#{repo_name}.git" } - subject.git_source(:foobar){ |repo_name| "git@foobar.com:#{repo_name}.git" } + subject.git_source(:example){|repo_name| "git@git.example.com:#{repo_name}.git" } + subject.git_source(:foobar){|repo_name| "git@foobar.com:#{repo_name}.git" } subject.gem("dobry-pies", :example => "strzalek/dobry-pies") example_uri = "git@git.example.com:strzalek/dobry-pies.git" expect(subject.dependencies.first.source.uri).to eq(example_uri) @@ -17,7 +17,7 @@ describe Bundler::Dsl do it "raises exception on invalid hostname" do expect { - subject.git_source(:group){ |repo_name| "git@git.example.com:#{repo_name}.git" } + subject.git_source(:group){|repo_name| "git@git.example.com:#{repo_name}.git" } }.to raise_error(Bundler::InvalidOption) end @@ -147,7 +147,7 @@ describe Bundler::Dsl do it "from a single repo" do rails_gems = ["railties", "action_pack", "active_model"] subject.git "https://github.com/rails/rails.git" do - rails_gems.each { |rails_gem| subject.send :gem, rails_gem } + rails_gems.each {|rails_gem| subject.send :gem, rails_gem } end expect(subject.dependencies.map(&:name)).to match_array rails_gems end @@ -162,7 +162,7 @@ describe Bundler::Dsl do it "from github" do spree_gems = ["spree_core", "spree_api", "spree_backend"] subject.github "spree" do - spree_gems.each { |spree_gem| subject.send :gem, spree_gem } + spree_gems.each {|spree_gem| subject.send :gem, spree_gem } end subject.dependencies.each do |d| diff --git a/spec/bundler/fetcher_spec.rb b/spec/bundler/fetcher_spec.rb index f312562367..d7da93774e 100644 --- a/spec/bundler/fetcher_spec.rb +++ b/spec/bundler/fetcher_spec.rb @@ -20,14 +20,14 @@ describe Bundler::Fetcher do describe "include CI information" do it "from one CI" do with_env_vars({ "JENKINS_URL" => "foo" }) do - ci_part = fetcher.user_agent.split(" ").find{|x| x.match(/\Aci\//)} + ci_part = fetcher.user_agent.split(" ").find{|x| x.match(/\Aci\//) } expect(ci_part).to match("jenkins") end end it "from many CI" do with_env_vars({ "TRAVIS" => "foo", "CI_NAME" => "my_ci" }) do - ci_part = fetcher.user_agent.split(" ").find{|x| x.match(/\Aci\//)} + ci_part = fetcher.user_agent.split(" ").find{|x| x.match(/\Aci\//) } expect(ci_part).to match("travis") expect(ci_part).to match("my_ci") end diff --git a/spec/bundler/gem_helper_spec.rb b/spec/bundler/gem_helper_spec.rb index f46b0f0423..d90dd12ef9 100644 --- a/spec/bundler/gem_helper_spec.rb +++ b/spec/bundler/gem_helper_spec.rb @@ -76,7 +76,7 @@ describe Bundler::GemHelper do before(:each) do content = app_gemspec_content.gsub("TODO: ", "") content.sub!(/homepage\s+= ".*"/, 'homepage = ""') - File.open(app_gemspec_path, "w") { |file| file << content } + File.open(app_gemspec_path, "w") {|file| file << content } end def remove_push_guard(gemspec_content) @@ -138,7 +138,7 @@ describe Bundler::GemHelper do context "when build failed" do it "raises an error with appropriate message" do # break the gemspec by adding back the TODOs - File.open(app_gemspec_path, "w"){ |file| file << app_gemspec_content } + File.open(app_gemspec_path, "w"){|file| file << app_gemspec_content } expect { subject.build_gem }.to raise_error(/TODO/) end end diff --git a/spec/cache/git_spec.rb b/spec/cache/git_spec.rb index 3ac19f6bc5..332513abad 100644 --- a/spec/cache/git_spec.rb +++ b/spec/cache/git_spec.rb @@ -172,7 +172,7 @@ end # Insert a gemspec method that shells out spec_lines = lib_path("foo-1.0/foo.gemspec").read.split("\n") spec_lines.insert(-2, "s.description = `echo bob`") - update_git("foo"){ |s| s.write "foo.gemspec", spec_lines.join("\n") } + update_git("foo"){|s| s.write "foo.gemspec", spec_lines.join("\n") } install_gemfile <<-G gem "foo", :git => '#{lib_path("foo-1.0")}' diff --git a/spec/commands/outdated_spec.rb b/spec/commands/outdated_spec.rb index a0d5f3036c..1d071e8254 100644 --- a/spec/commands/outdated_spec.rb +++ b/spec/commands/outdated_spec.rb @@ -32,7 +32,7 @@ describe "bundle outdated" do expect(out).to include("foo (newest 1.0") # Gem names are one per-line, between "*" and their parenthesized version. - gem_list = out.split("\n").map { |g| g[/\* (.*) \(/, 1] }.compact + gem_list = out.split("\n").map {|g| g[/\* (.*) \(/, 1] }.compact expect(gem_list).to eq(gem_list.sort) end diff --git a/spec/commands/show_spec.rb b/spec/commands/show_spec.rb index 1e24f11347..9da787c831 100644 --- a/spec/commands/show_spec.rb +++ b/spec/commands/show_spec.rb @@ -56,7 +56,7 @@ describe "bundle show" do expect(out).to include(default_bundle_path("gems", "rails-2.3.2").to_s) # Gem names are the last component of their path. - gem_list = out.split.map { |p| p.split("/").last } + gem_list = out.split.map {|p| p.split("/").last } expect(gem_list).to eq(gem_list.sort) end diff --git a/spec/install/post_bundle_message_spec.rb b/spec/install/post_bundle_message_spec.rb index 640d44baf9..1c7847ce50 100644 --- a/spec/install/post_bundle_message_spec.rb +++ b/spec/install/post_bundle_message_spec.rb @@ -13,11 +13,11 @@ describe "post bundle message" do G end - let(:bundle_show_message) {"Use `bundle show [gemname]` to see where a bundled gem is installed."} - let(:bundle_deployment_message) {"Bundled gems are installed into ./vendor"} - let(:bundle_complete_message) {"Bundle complete!"} - let(:bundle_updated_message) {"Bundle updated!"} - let(:installed_gems_stats) {"4 Gemfile dependencies, 5 gems now installed."} + let(:bundle_show_message) { "Use `bundle show [gemname]` to see where a bundled gem is installed." } + let(:bundle_deployment_message) { "Bundled gems are installed into ./vendor" } + let(:bundle_complete_message) { "Bundle complete!" } + let(:bundle_updated_message) { "Bundle updated!" } + let(:installed_gems_stats) { "4 Gemfile dependencies, 5 gems now installed." } describe "for fresh bundle install" do it "without any options" do diff --git a/spec/runtime/gem_tasks_spec.rb b/spec/runtime/gem_tasks_spec.rb index da88310b3b..c7641cfe22 100644 --- a/spec/runtime/gem_tasks_spec.rb +++ b/spec/runtime/gem_tasks_spec.rb @@ -28,7 +28,7 @@ describe "require 'bundler/gem_tasks'" do "rake install", "rake release[remote]", ] - tasks = out.lines.to_a.map { |s| s.split("#").first.strip } + tasks = out.lines.to_a.map {|s| s.split("#").first.strip } expect(tasks & expected_tasks).to eq(expected_tasks) expect(exitstatus).to eq(0) if exitstatus end diff --git a/spec/runtime/inline_spec.rb b/spec/runtime/inline_spec.rb index accbf7ce2c..73ced322e3 100644 --- a/spec/runtime/inline_spec.rb +++ b/spec/runtime/inline_spec.rb @@ -4,7 +4,7 @@ describe "bundler/inline#gemfile" do def script(code, options = {}) requires = ["bundler/inline"] requires.unshift File.expand_path("../../support/artifice/"+options.delete(:artifice)+".rb", __FILE__) if options.key?(:artifice) - requires = requires.map { |r| "require '#{r}'" }.join("\n") + requires = requires.map {|r| "require '#{r}'" }.join("\n") @out = ruby("#{requires}\n\n" << code, options) end diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index abd70545f0..8b5649040e 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -9,7 +9,7 @@ require "digest/sha1" begin require "rubygems" spec = Gem::Specification.load("bundler.gemspec") - rspec = spec.dependencies.find { |d| d.name == "rspec" } + rspec = spec.dependencies.find {|d| d.name == "rspec" } gem "rspec", rspec.requirement.to_s require "rspec" rescue LoadError diff --git a/spec/support/builders.rb b/spec/support/builders.rb index 4d7ad44418..c9159e6493 100644 --- a/spec/support/builders.rb +++ b/spec/support/builders.rb @@ -409,7 +409,7 @@ module Spec end def versions(versions) - versions.split(/\s+/).each { |version| yield v(version) } + versions.split(/\s+/).each {|version| yield v(version) } end end @@ -517,7 +517,7 @@ module Spec @files.each do |file, source| file = Pathname.new(path).join(file) FileUtils.mkdir_p(file.dirname) - File.open(file, "w") { |f| f.puts source } + File.open(file, "w") {|f| f.puts source } end @spec.files = @files.keys path diff --git a/spec/support/helpers.rb b/spec/support/helpers.rb index d179ea3ba0..cf8c6d2e3e 100644 --- a/spec/support/helpers.rb +++ b/spec/support/helpers.rb @@ -66,9 +66,9 @@ module Spec requires = options.delete(:requires) || [] requires << File.expand_path("../fakeweb/"+options.delete(:fakeweb)+".rb", __FILE__) if options.key?(:fakeweb) requires << File.expand_path("../artifice/"+options.delete(:artifice)+".rb", __FILE__) if options.key?(:artifice) - requires_str = requires.map{|r| "-r#{r}"}.join(" ") + requires_str = requires.map{|r| "-r#{r}" }.join(" ") - env = (options.delete(:env) || {}).map{|k, v| "#{k}='#{v}'"}.join(" ") + env = (options.delete(:env) || {}).map{|k, v| "#{k}='#{v}'" }.join(" ") args = options.map do |k, v| v == true ? " --#{k}" : " --#{k} #{v}" if v end.join @@ -86,9 +86,9 @@ module Spec requires = options.delete(:requires) || [] requires << File.expand_path("../fakeweb/"+options.delete(:fakeweb)+".rb", __FILE__) if options.key?(:fakeweb) requires << File.expand_path("../artifice/"+options.delete(:artifice)+".rb", __FILE__) if options.key?(:artifice) - requires_str = requires.map{|r| "-r#{r}"}.join(" ") + requires_str = requires.map{|r| "-r#{r}" }.join(" ") - env = (options.delete(:env) || {}).map{|k, v| "#{k}='#{v}' "}.join + env = (options.delete(:env) || {}).map{|k, v| "#{k}='#{v}' " }.join cmd = "#{env}#{Gem.ruby} -I#{lib} #{requires_str} #{bundle_bin}" sys_exec(cmd, expect_err){|i| yield i if block_given? } @@ -96,7 +96,7 @@ module Spec def ruby(ruby, options = {}) expect_err = options.delete(:expect_err) - env = (options.delete(:env) || {}).map{|k, v| "#{k}='#{v}' "}.join + env = (options.delete(:env) || {}).map{|k, v| "#{k}='#{v}' " }.join ruby.gsub!(/["`\$]/) {|m| "\\#{m}" } lib_option = options[:no_lib] ? "" : " -I#{lib}" sys_exec(%{#{env}#{Gem.ruby}#{lib_option} -e "#{ruby}"}, expect_err) @@ -355,7 +355,7 @@ module Spec changed_lines = pathname.readlines.map do |line| yield line end - File.open(pathname, "w") { |file| file.puts(changed_lines.join) } + File.open(pathname, "w") {|file| file.puts(changed_lines.join) } end def with_env_vars(env_hash, &block) diff --git a/spec/support/indexes.rb b/spec/support/indexes.rb index 9761a2cbba..119197d45a 100644 --- a/spec/support/indexes.rb +++ b/spec/support/indexes.rb @@ -7,7 +7,7 @@ module Spec def platform(*args) @platforms ||= [] - @platforms.concat args.map { |p| Gem::Platform.new(p) } + @platforms.concat args.map {|p| Gem::Platform.new(p) } end alias platforms platform diff --git a/spec/support/matchers.rb b/spec/support/matchers.rb index b4b18e7839..5d5e4a0572 100644 --- a/spec/support/matchers.rb +++ b/spec/support/matchers.rb @@ -4,13 +4,13 @@ module Spec dep = Bundler::Dependency.new(*args) match do |actual| - actual.length == 1 && actual.all? { |d| d == dep } + actual.length == 1 && actual.all? {|d| d == dep } end end RSpec::Matchers.define :have_gem do |*args| match do |actual| - actual.length == args.length && actual.all? { |a| args.include?(a.full_name) } + actual.length == args.length && actual.all? {|a| args.include?(a.full_name) } end end diff --git a/spec/support/platforms.rb b/spec/support/platforms.rb index 0512278660..fa12523a04 100644 --- a/spec/support/platforms.rb +++ b/spec/support/platforms.rb @@ -39,7 +39,7 @@ module Spec end def not_local - all_platforms.find { |p| p != generic(Gem::Platform.local) } + all_platforms.find {|p| p != generic(Gem::Platform.local) } end def local_tag @@ -51,7 +51,7 @@ module Spec end def not_local_tag - [:ruby, :jruby].find { |tag| tag != local_tag } + [:ruby, :jruby].find {|tag| tag != local_tag } end def local_ruby_engine diff --git a/spec/support/streams.rb b/spec/support/streams.rb index 6a0995133f..f89c506c93 100644 --- a/spec/support/streams.rb +++ b/spec/support/streams.rb @@ -4,10 +4,10 @@ def capture(*streams) streams.map!(&:to_s) begin result = StringIO.new - streams.each { |stream| eval "$#{stream} = result" } + streams.each {|stream| eval "$#{stream} = result" } yield ensure - streams.each { |stream| eval("$#{stream} = #{stream.upcase}") } + streams.each {|stream| eval("$#{stream} = #{stream.upcase}") } end result.string end |