bundler 1.2.5 → 1.3.0.pre

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of bundler might be problematic. Click here for more details.

Files changed (124) hide show
  1. data/.gitignore +10 -7
  2. data/.travis.yml +12 -3
  3. data/CHANGELOG.md +26 -19
  4. data/CONTRIBUTE.md +97 -0
  5. data/README.md +4 -2
  6. data/Rakefile +17 -59
  7. data/bundler.gemspec +2 -1
  8. data/lib/bundler.rb +23 -20
  9. data/lib/bundler/cli.rb +68 -22
  10. data/lib/bundler/definition.rb +3 -2
  11. data/lib/bundler/deprecate.rb +15 -0
  12. data/lib/bundler/dsl.rb +14 -16
  13. data/lib/bundler/environment.rb +0 -5
  14. data/lib/bundler/fetcher.rb +23 -78
  15. data/lib/bundler/friendly_errors.rb +4 -5
  16. data/lib/bundler/gem_helper.rb +14 -16
  17. data/lib/bundler/injector.rb +64 -0
  18. data/lib/bundler/installer.rb +1 -7
  19. data/lib/bundler/lazy_specification.rb +6 -3
  20. data/lib/bundler/lockfile_parser.rb +25 -13
  21. data/lib/bundler/resolver.rb +0 -1
  22. data/lib/bundler/rubygems_integration.rb +83 -17
  23. data/lib/bundler/settings.rb +4 -2
  24. data/lib/bundler/similarity_detector.rb +63 -0
  25. data/lib/bundler/source.rb +3 -886
  26. data/lib/bundler/source/git.rb +267 -0
  27. data/lib/bundler/source/git/git_proxy.rb +142 -0
  28. data/lib/bundler/source/path.rb +209 -0
  29. data/lib/bundler/source/path/installer.rb +33 -0
  30. data/lib/bundler/source/rubygems.rb +261 -0
  31. data/lib/bundler/templates/newgem/newgem.gemspec.tt +3 -0
  32. data/lib/bundler/templates/newgem/rspec.tt +2 -0
  33. data/lib/bundler/templates/newgem/spec/newgem_spec.rb.tt +9 -0
  34. data/lib/bundler/templates/newgem/spec/spec_helper.rb.tt +2 -0
  35. data/lib/bundler/templates/newgem/test/minitest_helper.rb.tt +4 -0
  36. data/lib/bundler/templates/newgem/test/test_newgem.rb.tt +11 -0
  37. data/lib/bundler/ui.rb +20 -5
  38. data/lib/bundler/vendor/.document +0 -0
  39. data/lib/bundler/vendor/thor.rb +74 -5
  40. data/lib/bundler/vendor/thor/actions.rb +5 -5
  41. data/lib/bundler/vendor/thor/actions/directory.rb +1 -0
  42. data/lib/bundler/vendor/thor/actions/file_manipulation.rb +7 -1
  43. data/lib/bundler/vendor/thor/base.rb +44 -11
  44. data/lib/bundler/vendor/thor/core_ext/hash_with_indifferent_access.rb +5 -0
  45. data/lib/bundler/vendor/thor/parser/argument.rb +14 -7
  46. data/lib/bundler/vendor/thor/parser/arguments.rb +7 -1
  47. data/lib/bundler/vendor/thor/parser/option.rb +8 -8
  48. data/lib/bundler/vendor/thor/parser/options.rb +62 -24
  49. data/lib/bundler/vendor/thor/runner.rb +1 -1
  50. data/lib/bundler/vendor/thor/shell/basic.rb +2 -2
  51. data/lib/bundler/vendor/thor/task.rb +2 -2
  52. data/lib/bundler/vendor/thor/version.rb +1 -1
  53. data/lib/bundler/vendored_persistent.rb +3 -15
  54. data/lib/bundler/version.rb +1 -1
  55. data/man/bundle-exec.ronn +1 -1
  56. data/man/bundle-update.ronn +1 -1
  57. data/man/bundle.ronn +4 -1
  58. data/spec/bundler/bundler_spec.rb +2 -28
  59. data/spec/bundler/cli_rspec.rb +9 -0
  60. data/spec/bundler/definition_spec.rb +1 -1
  61. data/spec/bundler/dsl_spec.rb +15 -8
  62. data/spec/bundler/gem_helper_spec.rb +38 -21
  63. data/spec/bundler/psyched_yaml_spec.rb +1 -0
  64. data/spec/bundler/source_spec.rb +3 -3
  65. data/spec/cache/gems_spec.rb +24 -24
  66. data/spec/cache/git_spec.rb +21 -23
  67. data/spec/cache/path_spec.rb +11 -11
  68. data/spec/cache/platform_spec.rb +6 -6
  69. data/spec/install/deploy_spec.rb +38 -38
  70. data/spec/install/gems/c_ext_spec.rb +2 -2
  71. data/spec/install/gems/dependency_api_spec.rb +23 -116
  72. data/spec/install/gems/env_spec.rb +1 -1
  73. data/spec/install/gems/flex_spec.rb +7 -8
  74. data/spec/install/gems/groups_spec.rb +10 -10
  75. data/spec/install/gems/packed_spec.rb +4 -4
  76. data/spec/install/gems/platform_spec.rb +3 -3
  77. data/spec/install/gems/post_install_spec.rb +9 -9
  78. data/spec/install/gems/resolving_spec.rb +2 -2
  79. data/spec/install/gems/simple_case_spec.rb +50 -53
  80. data/spec/install/gems/standalone_spec.rb +19 -19
  81. data/spec/install/gems/sudo_spec.rb +31 -16
  82. data/spec/install/gems/win32_spec.rb +1 -1
  83. data/spec/install/gemspec_spec.rb +6 -6
  84. data/spec/install/git_spec.rb +34 -34
  85. data/spec/install/invalid_spec.rb +3 -3
  86. data/spec/install/path_spec.rb +71 -8
  87. data/spec/install/upgrade_spec.rb +2 -2
  88. data/spec/integration/inject.rb +78 -0
  89. data/spec/lock/git_spec.rb +2 -2
  90. data/spec/lock/lockfile_spec.rb +14 -14
  91. data/spec/other/check_spec.rb +29 -29
  92. data/spec/other/clean_spec.rb +47 -48
  93. data/spec/other/config_spec.rb +20 -20
  94. data/spec/other/console_spec.rb +5 -5
  95. data/spec/other/exec_spec.rb +48 -28
  96. data/spec/other/ext_spec.rb +3 -3
  97. data/spec/other/help_spec.rb +6 -6
  98. data/spec/other/init_spec.rb +8 -8
  99. data/spec/other/newgem_spec.rb +95 -15
  100. data/spec/other/open_spec.rb +10 -5
  101. data/spec/other/outdated_spec.rb +8 -8
  102. data/spec/other/platform_spec.rb +45 -45
  103. data/spec/other/show_spec.rb +10 -10
  104. data/spec/quality_spec.rb +2 -2
  105. data/spec/realworld/dependency_api_spec.rb +61 -0
  106. data/spec/realworld/edgecases_spec.rb +8 -8
  107. data/spec/runtime/executable_spec.rb +13 -13
  108. data/spec/runtime/load_spec.rb +12 -12
  109. data/spec/runtime/platform_spec.rb +1 -1
  110. data/spec/runtime/require_spec.rb +24 -24
  111. data/spec/runtime/setup_spec.rb +113 -56
  112. data/spec/runtime/with_clean_env_spec.rb +11 -13
  113. data/spec/spec_helper.rb +6 -0
  114. data/spec/support/artifice/endpoint.rb +28 -13
  115. data/spec/support/artifice/endpoint_extra.rb +4 -0
  116. data/spec/support/builders.rb +1 -1
  117. data/spec/support/helpers.rb +2 -7
  118. data/spec/support/indexes.rb +3 -3
  119. data/spec/support/matchers.rb +6 -6
  120. data/spec/update/gems_spec.rb +19 -8
  121. data/spec/update/git_spec.rb +10 -10
  122. data/spec/update/source_spec.rb +1 -1
  123. metadata +86 -55
  124. data/.rspec +0 -2
@@ -3,7 +3,7 @@ require 'spec_helper'
3
3
  describe "Gem::Specification#match_platform" do
4
4
  it "does not match platforms other than the gem platform" do
5
5
  darwin = gem "lol", "1.0", "platform_specific-1.0-x86-darwin-10"
6
- darwin.match_platform(pl('java')).should be_false
6
+ expect(darwin.match_platform(pl('java'))).to be_false
7
7
  end
8
8
  end
9
9
 
@@ -11,7 +11,7 @@ describe "Bundler::GemHelpers#generic" do
11
11
  include Bundler::GemHelpers
12
12
 
13
13
  it "converts non-windows platforms into ruby" do
14
- generic(pl('x86-darwin-10')).should == pl('ruby')
14
+ expect(generic(pl('x86-darwin-10'))).to eq(pl('ruby'))
15
15
  end
16
16
  end
17
17
 
@@ -34,4 +34,4 @@ describe "Gem::SourceIndex#refresh!" do
34
34
  run "Gem.source_index.refresh!"
35
35
  run "Gem::SourceIndex.from_gems_in([]).refresh!"
36
36
  end
37
- end
37
+ end
@@ -7,33 +7,33 @@ describe "bundle help" do
7
7
  system_gems "bundler-0.8.1"
8
8
 
9
9
  bundle "help", :expect_err => true
10
- err.should include("Please remove Bundler 0.8 versions.")
11
- err.should include("This can be done by running `gem cleanup bundler`.")
10
+ expect(err).to include("Please remove Bundler 0.8 versions.")
11
+ expect(err).to include("This can be done by running `gem cleanup bundler`.")
12
12
  end
13
13
 
14
14
  it "uses groff when available" do
15
15
  fake_groff!
16
16
 
17
17
  bundle "help gemfile"
18
- out.should == %|["-Wall", "-mtty-char", "-mandoc", "-Tascii", "#{root}/lib/bundler/man/gemfile.5"]|
18
+ expect(out).to eq(%|["-Wall", "-mtty-char", "-mandoc", "-Tascii", "#{root}/lib/bundler/man/gemfile.5"]|)
19
19
  end
20
20
 
21
21
  it "prefixes bundle commands with bundle- when finding the groff files" do
22
22
  fake_groff!
23
23
 
24
24
  bundle "help install"
25
- out.should == %|["-Wall", "-mtty-char", "-mandoc", "-Tascii", "#{root}/lib/bundler/man/bundle-install"]|
25
+ expect(out).to eq(%|["-Wall", "-mtty-char", "-mandoc", "-Tascii", "#{root}/lib/bundler/man/bundle-install"]|)
26
26
  end
27
27
 
28
28
  it "simply outputs the txt file when there is no groff on the path" do
29
29
  kill_path!
30
30
 
31
31
  bundle "help install", :expect_err => true
32
- out.should =~ /BUNDLE-INSTALL/
32
+ expect(out).to match(/BUNDLE-INSTALL/)
33
33
  end
34
34
 
35
35
  it "still outputs the old help for commands that do not have man pages yet" do
36
36
  bundle "help check"
37
- out.should include("Check searches the local machine")
37
+ expect(out).to include("Check searches the local machine")
38
38
  end
39
39
  end
@@ -3,7 +3,7 @@ require "spec_helper"
3
3
  describe "bundle init" do
4
4
  it "generates a Gemfile" do
5
5
  bundle :init
6
- bundled_app("Gemfile").should exist
6
+ expect(bundled_app("Gemfile")).to exist
7
7
  end
8
8
 
9
9
  it "does not change existing Gemfiles" do
@@ -11,9 +11,9 @@ describe "bundle init" do
11
11
  gem "rails"
12
12
  G
13
13
 
14
- lambda {
14
+ expect {
15
15
  bundle :init
16
- }.should_not change { File.read(bundled_app("Gemfile")) }
16
+ }.not_to change { File.read(bundled_app("Gemfile")) }
17
17
  end
18
18
 
19
19
  it "should generate from an existing gemspec" do
@@ -31,10 +31,10 @@ describe "bundle init" do
31
31
  bundle :init, :gemspec => spec_file
32
32
 
33
33
  gemfile = bundled_app("Gemfile").read
34
- gemfile.should =~ /source :gemcutter/
35
- gemfile.scan(/gem "rack", "= 1.0.1"/).size.should eq(1)
36
- gemfile.scan(/gem "rspec", "= 1.2"/).size.should eq(1)
37
- gemfile.scan(/group :development/).size.should eq(1)
34
+ expect(gemfile).to match(/source :gemcutter/)
35
+ expect(gemfile.scan(/gem "rack", "= 1.0.1"/).size).to eq(1)
36
+ expect(gemfile.scan(/gem "rspec", "= 1.2"/).size).to eq(1)
37
+ expect(gemfile.scan(/group :development/).size).to eq(1)
38
38
  end
39
39
 
40
- end
40
+ end
@@ -19,30 +19,30 @@ describe "bundle gem" do
19
19
  let(:generated_gem) { Bundler::GemHelper.new(bundled_app("test-gem").to_s) }
20
20
 
21
21
  it "generates a gem skeleton" do
22
- bundled_app("test-gem/test-gem.gemspec").should exist
23
- bundled_app("test-gem/LICENSE.txt").should exist
24
- bundled_app("test-gem/Gemfile").should exist
25
- bundled_app("test-gem/Rakefile").should exist
26
- bundled_app("test-gem/lib/test-gem.rb").should exist
27
- bundled_app("test-gem/lib/test-gem/version.rb").should exist
22
+ expect(bundled_app("test-gem/test-gem.gemspec")).to exist
23
+ expect(bundled_app("test-gem/LICENSE.txt")).to exist
24
+ expect(bundled_app("test-gem/Gemfile")).to exist
25
+ expect(bundled_app("test-gem/Rakefile")).to exist
26
+ expect(bundled_app("test-gem/lib/test-gem.rb")).to exist
27
+ expect(bundled_app("test-gem/lib/test-gem/version.rb")).to exist
28
28
  end
29
29
 
30
30
  it "starts with version 0.0.1" do
31
- bundled_app("test-gem/lib/test-gem/version.rb").read.should =~ /VERSION = "0.0.1"/
31
+ expect(bundled_app("test-gem/lib/test-gem/version.rb").read).to match(/VERSION = "0.0.1"/)
32
32
  end
33
33
 
34
34
  it "nests constants so they work" do
35
- bundled_app("test-gem/lib/test-gem/version.rb").read.should =~ /module Test\n module Gem/
36
- bundled_app("test-gem/lib/test-gem.rb").read.should =~ /module Test\n module Gem/
35
+ expect(bundled_app("test-gem/lib/test-gem/version.rb").read).to match(/module Test\n module Gem/)
36
+ expect(bundled_app("test-gem/lib/test-gem.rb").read).to match(/module Test\n module Gem/)
37
37
  end
38
38
 
39
39
  context "git config user.{name,email} present" do
40
40
  it "sets gemspec author to git user.name if available" do
41
- generated_gem.gemspec.authors.first.should == "Bundler User"
41
+ expect(generated_gem.gemspec.authors.first).to eq("Bundler User")
42
42
  end
43
43
 
44
44
  it "sets gemspec email to git user.email if available" do
45
- generated_gem.gemspec.email.first.should == "user@example.com"
45
+ expect(generated_gem.gemspec.email.first).to eq("user@example.com")
46
46
  end
47
47
  end
48
48
 
@@ -56,16 +56,20 @@ describe "bundle gem" do
56
56
  end
57
57
 
58
58
  it "sets gemspec author to default message if git user.name is not set or empty" do
59
- generated_gem.gemspec.authors.first.should == "TODO: Write your name"
59
+ expect(generated_gem.gemspec.authors.first).to eq("TODO: Write your name")
60
60
  end
61
61
 
62
62
  it "sets gemspec email to default message if git user.email is not set or empty" do
63
- generated_gem.gemspec.email.first.should == "TODO: Write your email address"
63
+ expect(generated_gem.gemspec.email.first).to eq("TODO: Write your email address")
64
64
  end
65
65
  end
66
66
 
67
+ it "sets gemspec license to MIT by default" do
68
+ expect(generated_gem.gemspec.license).to eq("MIT")
69
+ end
70
+
67
71
  it "requires the version file" do
68
- bundled_app("test-gem/lib/test-gem.rb").read.should =~ /require "test-gem\/version"/
72
+ expect(bundled_app("test-gem/lib/test-gem.rb").read).to match(/require "test-gem\/version"/)
69
73
  end
70
74
 
71
75
  it "runs rake without problems" do
@@ -82,7 +86,83 @@ RAKEFILE
82
86
 
83
87
  Dir.chdir(bundled_app("test-gem")) do
84
88
  sys_exec("rake")
85
- out.should include("SUCCESS")
89
+ expect(out).to include("SUCCESS")
90
+ end
91
+ end
92
+
93
+ context "--bin parameter set" do
94
+ before :each do
95
+ reset!
96
+ in_app_root
97
+ bundle 'gem test-gem --bin'
98
+ end
99
+
100
+ it "builds bin skeleton" do
101
+ expect(bundled_app("test-gem/bin/test-gem")).to exist
102
+ end
103
+
104
+ it "requires 'test-gem'" do
105
+ expect(bundled_app("test-gem/bin/test-gem").read).to match(/require 'test-gem'/)
106
+ end
107
+ end
108
+
109
+ context "--test parameter set to rspec" do
110
+ before :each do
111
+ reset!
112
+ in_app_root
113
+ bundle "gem test-gem --test=rspec"
114
+ end
115
+
116
+ it "builds spec skeleton" do
117
+ expect(bundled_app("test-gem/.rspec")).to exist
118
+ expect(bundled_app("test-gem/spec/test-gem_spec.rb")).to exist
119
+ expect(bundled_app("test-gem/spec/spec_helper.rb")).to exist
120
+ end
121
+
122
+ it "requires 'test-gem'" do
123
+ expect(bundled_app("test-gem/spec/spec_helper.rb").read).to match(/require 'test-gem'/)
124
+ end
125
+
126
+ it "creates a default test which fails" do
127
+ expect(bundled_app("test-gem/spec/test-gem_spec.rb").read).to match(/false.should be_true/)
128
+ end
129
+ end
130
+
131
+ context "--test parameter set to minitest" do
132
+ before :each do
133
+ reset!
134
+ in_app_root
135
+ bundle "gem test-gem --test=minitest"
136
+ end
137
+
138
+ it "builds spec skeleton" do
139
+ expect(bundled_app("test-gem/test/test_test-gem.rb")).to exist
140
+ expect(bundled_app("test-gem/test/minitest_helper.rb")).to exist
141
+ end
142
+
143
+ it "requires 'test-gem'" do
144
+ expect(bundled_app("test-gem/test/minitest_helper.rb").read).to match(/require 'test-gem'/)
145
+ end
146
+
147
+ it "requires 'minitest_helper'" do
148
+ expect(bundled_app("test-gem/test/test_test-gem.rb").read).to match(/require '.\/minitest_helper'/)
149
+ end
150
+
151
+ it "creates a default test which fails" do
152
+ expect(bundled_app("test-gem/test/test_test-gem.rb").read).to match(/assert false/)
153
+ end
154
+ end
155
+
156
+ context "--test with no arguments" do
157
+ before :each do
158
+ reset!
159
+ in_app_root
160
+ bundle "gem test-gem --test"
161
+ end
162
+
163
+ it "defaults to rspec" do
164
+ expect(bundled_app("test-gem/spec/spec_helper.rb")).to exist
165
+ expect(bundled_app("test-gem/test/minitest_helper.rb")).to_not exist
86
166
  end
87
167
  end
88
168
  end
@@ -10,26 +10,31 @@ describe "bundle open" do
10
10
 
11
11
  it "opens the gem with BUNDLER_EDITOR as highest priority" do
12
12
  bundle "open rails", :env => {"EDITOR" => "echo editor", "VISUAL" => "echo visual", "BUNDLER_EDITOR" => "echo bundler_editor"}
13
- out.should == "bundler_editor #{default_bundle_path('gems', 'rails-2.3.2')}"
13
+ expect(out).to eq("bundler_editor #{default_bundle_path('gems', 'rails-2.3.2')}")
14
14
  end
15
15
 
16
16
  it "opens the gem with VISUAL as 2nd highest priority" do
17
17
  bundle "open rails", :env => {"EDITOR" => "echo editor", "VISUAL" => "echo visual", "BUNDLER_EDITOR" => ""}
18
- out.should == "visual #{default_bundle_path('gems', 'rails-2.3.2')}"
18
+ expect(out).to eq("visual #{default_bundle_path('gems', 'rails-2.3.2')}")
19
19
  end
20
20
 
21
21
  it "opens the gem with EDITOR as 3rd highest priority" do
22
22
  bundle "open rails", :env => {"EDITOR" => "echo editor", "VISUAL" => "", "BUNDLER_EDITOR" => ""}
23
- out.should == "editor #{default_bundle_path('gems', 'rails-2.3.2')}"
23
+ expect(out).to eq("editor #{default_bundle_path('gems', 'rails-2.3.2')}")
24
24
  end
25
25
 
26
26
  it "complains if no EDITOR is set" do
27
27
  bundle "open rails", :env => {"EDITOR" => "", "VISUAL" => "", "BUNDLER_EDITOR" => ""}
28
- out.should == "To open a bundled gem, set $EDITOR or $BUNDLER_EDITOR"
28
+ expect(out).to eq("To open a bundled gem, set $EDITOR or $BUNDLER_EDITOR")
29
29
  end
30
30
 
31
31
  it "complains if gem not in bundle" do
32
32
  bundle "open missing", :env => {"EDITOR" => "echo editor", "VISUAL" => "", "BUNDLER_EDITOR" => ""}
33
- out.should match(/could not find gem 'missing'/i)
33
+ expect(out).to match(/could not find gem 'missing'/i)
34
+ end
35
+
36
+ it "suggests alternatives for similar-sounding gems" do
37
+ bundle "open Rails", :env => {"EDITOR" => "echo editor", "VISUAL" => "", "BUNDLER_EDITOR" => ""}
38
+ expect(out).to match(/did you mean rails\?/i)
34
39
  end
35
40
  end
@@ -22,8 +22,8 @@ describe "bundle outdated" do
22
22
  end
23
23
 
24
24
  bundle "outdated"
25
- out.should include("activesupport (3.0 > 2.3.5)")
26
- out.should include("foo (1.0")
25
+ expect(out).to include("activesupport (3.0 > 2.3.5)")
26
+ expect(out).to include("foo (1.0")
27
27
  end
28
28
  end
29
29
 
@@ -32,7 +32,7 @@ describe "bundle outdated" do
32
32
  FileUtils.rm_rf(gem_repo2)
33
33
 
34
34
  bundle "outdated --local"
35
- out.should_not match(/Fetching/)
35
+ expect(out).not_to match(/Fetching/)
36
36
  end
37
37
  end
38
38
 
@@ -44,8 +44,8 @@ describe "bundle outdated" do
44
44
  end
45
45
 
46
46
  bundle "outdated foo"
47
- out.should_not include("activesupport (3.0 > 2.3.5)")
48
- out.should include("foo (1.0")
47
+ expect(out).not_to include("activesupport (3.0 > 2.3.5)")
48
+ expect(out).to include("foo (1.0")
49
49
  end
50
50
  end
51
51
 
@@ -57,7 +57,7 @@ describe "bundle outdated" do
57
57
  end
58
58
 
59
59
  bundle "outdated"
60
- out.should_not include("activesupport (3.0.0.beta > 2.3.5)")
60
+ expect(out).not_to include("activesupport (3.0.0.beta > 2.3.5)")
61
61
  end
62
62
  end
63
63
 
@@ -68,7 +68,7 @@ describe "bundle outdated" do
68
68
  end
69
69
 
70
70
  bundle "outdated --pre"
71
- out.should include("activesupport (3.0.0.beta > 2.3.5)")
71
+ expect(out).to include("activesupport (3.0.0.beta > 2.3.5)")
72
72
  end
73
73
  end
74
74
 
@@ -85,7 +85,7 @@ describe "bundle outdated" do
85
85
  G
86
86
 
87
87
  bundle "outdated"
88
- out.should include("activesupport (3.0.0.beta.2 > 3.0.0.beta.1)")
88
+ expect(out).to include("activesupport (3.0.0.beta.2 > 3.0.0.beta.1)")
89
89
  end
90
90
  end
91
91
  end
@@ -12,7 +12,7 @@ describe "bundle platform" do
12
12
  G
13
13
 
14
14
  bundle "platform"
15
- out.should == <<-G.chomp
15
+ expect(out).to eq(<<-G.chomp)
16
16
  Your platform is: #{RUBY_PLATFORM}
17
17
 
18
18
  Your app has gems that work on these platforms:
@@ -33,7 +33,7 @@ G
33
33
  G
34
34
 
35
35
  bundle "platform"
36
- out.should == <<-G.chomp
36
+ expect(out).to eq(<<-G.chomp)
37
37
  Your platform is: #{RUBY_PLATFORM}
38
38
 
39
39
  Your app has gems that work on these platforms:
@@ -53,7 +53,7 @@ G
53
53
  G
54
54
 
55
55
  bundle "platform"
56
- out.should == <<-G.chomp
56
+ expect(out).to eq(<<-G.chomp)
57
57
  Your platform is: #{RUBY_PLATFORM}
58
58
 
59
59
  Your app has gems that work on these platforms:
@@ -78,7 +78,7 @@ G
78
78
 
79
79
  bundle "platform --ruby"
80
80
 
81
- out.should eq("ruby 1.9.3")
81
+ expect(out).to eq("ruby 1.9.3")
82
82
  end
83
83
 
84
84
  it "engine defaults to MRI" do
@@ -91,7 +91,7 @@ G
91
91
 
92
92
  bundle "platform --ruby"
93
93
 
94
- out.should eq("ruby 1.9.3")
94
+ expect(out).to eq("ruby 1.9.3")
95
95
  end
96
96
 
97
97
  it "handles jruby" do
@@ -104,7 +104,7 @@ G
104
104
 
105
105
  bundle "platform --ruby"
106
106
 
107
- out.should eq("ruby 1.8.7 (jruby 1.6.5)")
107
+ expect(out).to eq("ruby 1.8.7 (jruby 1.6.5)")
108
108
  end
109
109
 
110
110
  it "handles rbx" do
@@ -117,7 +117,7 @@ G
117
117
 
118
118
  bundle "platform --ruby"
119
119
 
120
- out.should eq("ruby 1.8.7 (rbx 1.2.4)")
120
+ expect(out).to eq("ruby 1.8.7 (rbx 1.2.4)")
121
121
  end
122
122
 
123
123
  it "raises an error if engine is used but engine version is not" do
@@ -130,7 +130,7 @@ G
130
130
 
131
131
  bundle "platform", :exitstatus => true
132
132
 
133
- exitstatus.should_not == 0
133
+ expect(exitstatus).not_to eq(0)
134
134
  end
135
135
 
136
136
  it "raises an error if engine_version is used but engine is not" do
@@ -143,7 +143,7 @@ G
143
143
 
144
144
  bundle "platform", :exitstatus => true
145
145
 
146
- exitstatus.should_not == 0
146
+ expect(exitstatus).not_to eq(0)
147
147
  end
148
148
 
149
149
  it "raises an error if engine version doesn't match ruby version for mri" do
@@ -156,7 +156,7 @@ G
156
156
 
157
157
  bundle "platform", :exitstatus => true
158
158
 
159
- exitstatus.should_not == 0
159
+ expect(exitstatus).not_to eq(0)
160
160
  end
161
161
 
162
162
  it "should print if no ruby version is specified" do
@@ -169,7 +169,7 @@ G
169
169
  bundle "platform --ruby"
170
170
  puts err
171
171
 
172
- out.should eq("No ruby version specified")
172
+ expect(out).to eq("No ruby version specified")
173
173
  end
174
174
  end
175
175
 
@@ -180,18 +180,18 @@ G
180
180
  let(:engine_version_incorrect) { "ruby \"#{RUBY_VERSION}\", :engine => \"#{local_ruby_engine}\", :engine_version => \"#{not_local_engine_version}\"" }
181
181
 
182
182
  def should_be_ruby_version_incorrect(opts = {:exitstatus => true})
183
- exitstatus.should eq(18) if opts[:exitstatus]
184
- out.should be_include("Your Ruby version is #{RUBY_VERSION}, but your Gemfile specified #{not_local_ruby_version}")
183
+ expect(exitstatus).to eq(18) if opts[:exitstatus]
184
+ expect(out).to be_include("Your Ruby version is #{RUBY_VERSION}, but your Gemfile specified #{not_local_ruby_version}")
185
185
  end
186
186
 
187
187
  def should_be_engine_incorrect(opts = {:exitstatus => true})
188
- exitstatus.should eq(18) if opts[:exitstatus]
189
- out.should be_include("Your Ruby engine is #{local_ruby_engine}, but your Gemfile specified #{not_local_tag}")
188
+ expect(exitstatus).to eq(18) if opts[:exitstatus]
189
+ expect(out).to be_include("Your Ruby engine is #{local_ruby_engine}, but your Gemfile specified #{not_local_tag}")
190
190
  end
191
191
 
192
192
  def should_be_engine_version_incorrect(opts = {:exitstatus => true})
193
- exitstatus.should eq(18) if opts[:exitstatus]
194
- out.should be_include("Your #{local_ruby_engine} version is #{local_engine_version}, but your Gemfile specified #{local_ruby_engine} #{not_local_engine_version}")
193
+ expect(exitstatus).to eq(18) if opts[:exitstatus]
194
+ expect(out).to be_include("Your #{local_ruby_engine} version is #{local_engine_version}, but your Gemfile specified #{local_ruby_engine} #{not_local_engine_version}")
195
195
  end
196
196
 
197
197
  context "bundle install" do
@@ -203,7 +203,7 @@ G
203
203
  #{ruby_version_correct}
204
204
  G
205
205
 
206
- bundled_app('Gemfile.lock').should exist
206
+ expect(bundled_app('Gemfile.lock')).to exist
207
207
  end
208
208
 
209
209
  it "installs fine with any engine" do
@@ -215,7 +215,7 @@ G
215
215
  #{ruby_version_correct_engineless}
216
216
  G
217
217
 
218
- bundled_app('Gemfile.lock').should exist
218
+ expect(bundled_app('Gemfile.lock')).to exist
219
219
  end
220
220
  end
221
221
 
@@ -227,7 +227,7 @@ G
227
227
  #{ruby_version_incorrect}
228
228
  G
229
229
 
230
- bundled_app('Gemfile.lock').should_not exist
230
+ expect(bundled_app('Gemfile.lock')).not_to exist
231
231
  should_be_ruby_version_incorrect
232
232
  end
233
233
 
@@ -239,7 +239,7 @@ G
239
239
  #{engine_incorrect}
240
240
  G
241
241
 
242
- bundled_app('Gemfile.lock').should_not exist
242
+ expect(bundled_app('Gemfile.lock')).not_to exist
243
243
  should_be_engine_incorrect
244
244
  end
245
245
 
@@ -252,7 +252,7 @@ G
252
252
  #{engine_version_incorrect}
253
253
  G
254
254
 
255
- bundled_app('Gemfile.lock').should_not exist
255
+ expect(bundled_app('Gemfile.lock')).not_to exist
256
256
  should_be_engine_version_incorrect
257
257
  end
258
258
  end
@@ -273,8 +273,8 @@ G
273
273
  G
274
274
 
275
275
  bundle :check, :exitstatus => true
276
- exitstatus.should eq(0)
277
- out.should == "The Gemfile's dependencies are satisfied"
276
+ expect(exitstatus).to eq(0)
277
+ expect(out).to eq("The Gemfile's dependencies are satisfied")
278
278
  end
279
279
 
280
280
  it "checks fine with any engine" do
@@ -292,8 +292,8 @@ G
292
292
  G
293
293
 
294
294
  bundle :check, :exitstatus => true
295
- exitstatus.should eq(0)
296
- out.should == "The Gemfile's dependencies are satisfied"
295
+ expect(exitstatus).to eq(0)
296
+ expect(out).to eq("The Gemfile's dependencies are satisfied")
297
297
  end
298
298
  end
299
299
 
@@ -464,7 +464,7 @@ G
464
464
  G
465
465
 
466
466
  bundle "show rails"
467
- out.should == default_bundle_path('gems', 'rails-2.3.2').to_s
467
+ expect(out).to eq(default_bundle_path('gems', 'rails-2.3.2').to_s)
468
468
  end
469
469
 
470
470
  it "prints path if ruby version is correct for any engine" do
@@ -477,7 +477,7 @@ G
477
477
  G
478
478
 
479
479
  bundle "show rails"
480
- out.should == default_bundle_path('gems', 'rails-2.3.2').to_s
480
+ expect(out).to eq(default_bundle_path('gems', 'rails-2.3.2').to_s)
481
481
  end
482
482
  end
483
483
 
@@ -537,7 +537,7 @@ G
537
537
  G
538
538
 
539
539
  bundle :cache
540
- bundled_app("vendor/cache/rack-1.0.0.gem").should exist
540
+ expect(bundled_app("vendor/cache/rack-1.0.0.gem")).to exist
541
541
  end
542
542
 
543
543
  it "copies the .gem file to vendor/cache when ruby version matches for any engine" do
@@ -549,7 +549,7 @@ G
549
549
  G
550
550
 
551
551
  bundle :cache
552
- bundled_app("vendor/cache/rack-1.0.0.gem").should exist
552
+ expect(bundled_app("vendor/cache/rack-1.0.0.gem")).to exist
553
553
  end
554
554
  end
555
555
 
@@ -606,7 +606,7 @@ G
606
606
  G
607
607
 
608
608
  bundle :pack
609
- bundled_app("vendor/cache/rack-1.0.0.gem").should exist
609
+ expect(bundled_app("vendor/cache/rack-1.0.0.gem")).to exist
610
610
  end
611
611
 
612
612
  it "copies the .gem file to vendor/cache when ruby version matches any engine" do
@@ -618,7 +618,7 @@ G
618
618
  G
619
619
 
620
620
  bundle :pack
621
- bundled_app("vendor/cache/rack-1.0.0.gem").should exist
621
+ expect(bundled_app("vendor/cache/rack-1.0.0.gem")).to exist
622
622
  end
623
623
  end
624
624
 
@@ -671,7 +671,7 @@ G
671
671
  G
672
672
 
673
673
  bundle "exec rackup"
674
- out.should == "0.9.1"
674
+ expect(out).to eq("0.9.1")
675
675
  end
676
676
 
677
677
  it "activates the correct gem when ruby version matches any engine" do
@@ -683,7 +683,7 @@ G
683
683
  G
684
684
 
685
685
  bundle "exec rackup"
686
- out.should == "0.9.1"
686
+ expect(out).to eq("0.9.1")
687
687
  end
688
688
  end
689
689
 
@@ -747,7 +747,7 @@ G
747
747
  input.puts("puts RACK")
748
748
  input.puts("exit")
749
749
  end
750
- out.should include("0.9.1")
750
+ expect(out).to include("0.9.1")
751
751
  end
752
752
 
753
753
  it "starts IRB with the default group loaded when ruby version matches any engine" do
@@ -765,7 +765,7 @@ G
765
765
  input.puts("puts RACK")
766
766
  input.puts("exit")
767
767
  end
768
- out.should include("0.9.1")
768
+ expect(out).to include("0.9.1")
769
769
  end
770
770
  end
771
771
 
@@ -837,7 +837,7 @@ G
837
837
  FileUtils.rm(bundled_app("Gemfile.lock"))
838
838
 
839
839
  run "1"
840
- bundled_app("Gemfile.lock").should exist
840
+ expect(bundled_app("Gemfile.lock")).to exist
841
841
  end
842
842
 
843
843
  it "makes a Gemfile.lock if setup succeeds for any engine" do
@@ -855,7 +855,7 @@ G
855
855
  FileUtils.rm(bundled_app("Gemfile.lock"))
856
856
 
857
857
  run "1"
858
- bundled_app("Gemfile.lock").should exist
858
+ expect(bundled_app("Gemfile.lock")).to exist
859
859
  end
860
860
  end
861
861
 
@@ -883,7 +883,7 @@ G
883
883
  end
884
884
  R
885
885
 
886
- bundled_app("Gemfile.lock").should_not exist
886
+ expect(bundled_app("Gemfile.lock")).not_to exist
887
887
  should_be_ruby_version_incorrect(:exitstatus => false)
888
888
  end
889
889
 
@@ -911,7 +911,7 @@ G
911
911
  end
912
912
  R
913
913
 
914
- bundled_app("Gemfile.lock").should_not exist
914
+ expect(bundled_app("Gemfile.lock")).not_to exist
915
915
  should_be_engine_incorrect(:exitstatus => false)
916
916
  end
917
917
 
@@ -940,7 +940,7 @@ G
940
940
  end
941
941
  R
942
942
 
943
- bundled_app("Gemfile.lock").should_not exist
943
+ expect(bundled_app("Gemfile.lock")).not_to exist
944
944
  should_be_engine_version_incorrect(:exitstatus => false)
945
945
  end
946
946
  end
@@ -974,8 +974,8 @@ G
974
974
  G
975
975
 
976
976
  bundle "outdated"
977
- out.should include("activesupport (3.0 > 2.3.5)")
978
- out.should include("foo (1.0")
977
+ expect(out).to include("activesupport (3.0 > 2.3.5)")
978
+ expect(out).to include("foo (1.0")
979
979
  end
980
980
 
981
981
  it "returns list of outdated gems when the ruby version matches for any engine" do
@@ -994,8 +994,8 @@ G
994
994
  G
995
995
 
996
996
  bundle "outdated"
997
- out.should include("activesupport (3.0 > 2.3.5)")
998
- out.should include("foo (1.0")
997
+ expect(out).to include("activesupport (3.0 > 2.3.5)")
998
+ expect(out).to include("foo (1.0")
999
999
  end
1000
1000
  end
1001
1001