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
@@ -2,5 +2,5 @@ module Bundler
2
2
  # We're doing this because we might write tests that deal
3
3
  # with other versions of bundler and we are unsure how to
4
4
  # handle this better.
5
- VERSION = "1.2.5" unless defined?(::Bundler::VERSION)
5
+ VERSION = "1.3.0.pre" unless defined?(::Bundler::VERSION)
6
6
  end
@@ -59,7 +59,7 @@ It also modifies Rubygems:
59
59
  ### Shelling out
60
60
 
61
61
  When shelling out (using the `system` or backticks methods,
62
- for example), Bundler's environment changes will propogate to
62
+ for example), Bundler's environment changes will propagate to
63
63
  the subshell environment. If you desire to shell out without
64
64
  Bundler's environment changes, simply employ the `with_clean_env`
65
65
  method. It will restore all environment variables to what they
@@ -39,7 +39,7 @@ When you run [bundle install(1)][bundle-install] the first time, bundler will re
39
39
  all of the dependencies, all the way down, and install what you need:
40
40
 
41
41
  Fetching source index for http://rubygems.org/
42
- Installing rake (10.0.2)
42
+ Installing rake (0.8.7)
43
43
  Installing abstract (1.0.0)
44
44
  Installing activesupport (3.0.0.rc)
45
45
  Installing builder (2.1.2)
@@ -43,6 +43,9 @@ We divide `bundle` subcommands into primary commands and utilities.
43
43
  * [bundle config(1)][bundle-config]:
44
44
  Specify and read configuration options for bundler
45
45
 
46
+ * `bundle help(1)`:
47
+ Displays this help page
48
+
46
49
  ## UTILITIES
47
50
 
48
51
  * `bundle check(1)`:
@@ -73,7 +76,7 @@ We divide `bundle` subcommands into primary commands and utilities.
73
76
  * `bundle gem(1)`:
74
77
  Create a simple gem, suitable for development with bundler
75
78
 
76
- * `bundle platform(1)`:
79
+ * [bundle platform(1)][bundle-platform]:
77
80
  Displays platform compatibility information
78
81
 
79
82
  ## OBSOLETE
@@ -1,4 +1,3 @@
1
- # encoding: utf-8
2
1
  require 'spec_helper'
3
2
  require 'bundler'
4
3
 
@@ -12,34 +11,9 @@ GEMSPEC
12
11
  file.puts gemspec
13
12
  end
14
13
 
15
- proc {
14
+ expect(proc {
16
15
  Bundler.load_gemspec_uncached(tmp("test.gemspec"))
17
- }.should raise_error(Bundler::GemspecError)
18
- end
19
-
20
- it "can load a gemspec with unicode characters with default ruby encoding" do
21
- # spec_helper forces the external encoding to UTF-8 but that's not the
22
- # ruby default.
23
- encoding = nil
24
-
25
- if defined?(Encoding)
26
- encoding = Encoding.default_external
27
- Encoding.default_external = "ASCII"
28
- end
29
-
30
- File.open(tmp("test.gemspec"), "wb") do |file|
31
- file.puts <<-G.gsub(/^\s+/, '')
32
- # -*- encoding: utf-8 -*-
33
- Gem::Specification.new do |gem|
34
- gem.author = "André the Giant"
35
- end
36
- G
37
- end
38
-
39
- gemspec = Bundler.load_gemspec_uncached(tmp("test.gemspec"))
40
- gemspec.author.should == "André the Giant"
41
-
42
- Encoding.default_external = encoding if defined?(Encoding)
16
+ }).to raise_error(Bundler::GemspecError)
43
17
  end
44
18
  end
45
19
  end
@@ -0,0 +1,9 @@
1
+ require 'spec_helper'
2
+
3
+
4
+ describe 'bundle executable' do
5
+ it 'returns non-zero exit status when passed unrecognized options' do
6
+ bundle '--invalid_argument', :exitstatus => true
7
+ expect(exitstatus).to_not be_zero
8
+ end
9
+ end
@@ -22,4 +22,4 @@ describe Bundler::Definition do
22
22
  end
23
23
  end
24
24
 
25
- end
25
+ end
@@ -10,14 +10,21 @@ describe Bundler::Dsl do
10
10
  it "should convert :github to :git" do
11
11
  subject.gem("sparks", :github => "indirect/sparks")
12
12
  github_uri = "git://github.com/indirect/sparks.git"
13
- subject.dependencies.first.source.uri.should == github_uri
13
+ expect(subject.dependencies.first.source.uri).to eq(github_uri)
14
14
  end
15
15
 
16
16
  it "should convert 'rails' to 'rails/rails'" do
17
17
  subject.gem("rails", :github => "rails")
18
18
  github_uri = "git://github.com/rails/rails.git"
19
- subject.dependencies.first.source.uri.should == github_uri
19
+ expect(subject.dependencies.first.source.uri).to eq(github_uri)
20
20
  end
21
+
22
+ it "should interpret slashless 'github:' value as account name" do
23
+ subject.gem("bundler", :github => "carlhuda")
24
+ github_uri = "git://github.com/carlhuda/bundler.git"
25
+ expect(subject.dependencies.first.source.uri).to eq(github_uri)
26
+ end
27
+
21
28
  end
22
29
 
23
30
  describe '#method_missing' do
@@ -25,24 +32,24 @@ describe Bundler::Dsl do
25
32
  Bundler.should_receive(:read_file).with("Gemfile").and_return("unknown")
26
33
  error_msg = "Undefined local variable or method `unknown'" \
27
34
  " for Gemfile\\s+from Gemfile:1"
28
- lambda{ subject.eval_gemfile("Gemfile") }.
29
- should raise_error(Bundler::GemfileError, Regexp.new(error_msg))
35
+ expect { subject.eval_gemfile("Gemfile") }.
36
+ to raise_error(Bundler::GemfileError, Regexp.new(error_msg))
30
37
  end
31
38
  end
32
39
 
33
40
  describe "#eval_gemfile" do
34
41
  it "handles syntax errors with a useful message" do
35
42
  Bundler.should_receive(:read_file).with("Gemfile").and_return("}")
36
- lambda{ subject.eval_gemfile("Gemfile") }.
37
- should raise_error(Bundler::GemfileError, /Gemfile syntax error/)
43
+ expect { subject.eval_gemfile("Gemfile") }.
44
+ to raise_error(Bundler::GemfileError, /Gemfile syntax error/)
38
45
  end
39
46
  end
40
47
 
41
48
  describe "syntax errors" do
42
49
  it "should raise a Bundler::GemfileError" do
43
50
  gemfile "gem 'foo', :path => /unquoted/string/syntax/error"
44
- lambda { Bundler::Dsl.evaluate(bundled_app("Gemfile"), nil, true) }.
45
- should raise_error(Bundler::GemfileError)
51
+ expect { Bundler::Dsl.evaluate(bundled_app("Gemfile"), nil, true) }.
52
+ to raise_error(Bundler::GemfileError)
46
53
  end
47
54
  end
48
55
  end
@@ -8,7 +8,7 @@ describe "Bundler::GemHelper tasks" do
8
8
  bundle 'gem test'
9
9
  app = bundled_app("test")
10
10
  helper = Bundler::GemHelper.new(app.to_s)
11
- helper.gemspec.name.should == 'test'
11
+ expect(helper.gemspec.name).to eq('test')
12
12
  end
13
13
 
14
14
  it "interpolates the name for a hidden gemspec" do
@@ -16,28 +16,28 @@ describe "Bundler::GemHelper tasks" do
16
16
  app = bundled_app("test")
17
17
  FileUtils.mv app.join('test.gemspec'), app.join('.gemspec')
18
18
  helper = Bundler::GemHelper.new(app.to_s)
19
- helper.gemspec.name.should == 'test'
19
+ expect(helper.gemspec.name).to eq('test')
20
20
  end
21
21
 
22
22
  it "should fail when there is no gemspec" do
23
23
  bundle 'gem test'
24
24
  app = bundled_app("test")
25
25
  FileUtils.rm(File.join(app.to_s, 'test.gemspec'))
26
- proc { Bundler::GemHelper.new(app.to_s) }.should raise_error(/Unable to determine name/)
26
+ expect { Bundler::GemHelper.new(app.to_s) }.to raise_error(/Unable to determine name/)
27
27
  end
28
28
 
29
29
  it "should fail when there are two gemspecs and the name isn't specified" do
30
30
  bundle 'gem test'
31
31
  app = bundled_app("test")
32
32
  File.open(File.join(app.to_s, 'test2.gemspec'), 'w') {|f| f << ''}
33
- proc { Bundler::GemHelper.new(app.to_s) }.should raise_error(/Unable to determine name/)
33
+ expect { Bundler::GemHelper.new(app.to_s) }.to raise_error(/Unable to determine name/)
34
34
  end
35
35
 
36
36
  it "handles namespaces and converting to CamelCase" do
37
37
  bundle 'gem test-foo_bar'
38
38
  lib = bundled_app('test-foo_bar').join('lib/test-foo_bar.rb').read
39
- lib.should include("module Test")
40
- lib.should include("module FooBar")
39
+ expect(lib).to include("module Test")
40
+ expect(lib).to include("module FooBar")
41
41
  end
42
42
  end
43
43
 
@@ -47,7 +47,7 @@ describe "Bundler::GemHelper tasks" do
47
47
  end
48
48
 
49
49
  def mock_build_message
50
- mock_confirm_message "test 0.0.1 built to pkg/test-0.0.1.gem"
50
+ mock_confirm_message "test 0.0.1 built to pkg/test-0.0.1.gem."
51
51
  end
52
52
 
53
53
  before(:each) do
@@ -59,7 +59,7 @@ describe "Bundler::GemHelper tasks" do
59
59
  end
60
60
 
61
61
  it "uses a shell UI for output" do
62
- Bundler.ui.should be_a(Bundler::UI::Shell)
62
+ expect(Bundler.ui).to be_a(Bundler::UI::Shell)
63
63
  end
64
64
 
65
65
  describe 'install_tasks' do
@@ -75,20 +75,20 @@ describe "Bundler::GemHelper tasks" do
75
75
  names = %w[build install release]
76
76
 
77
77
  names.each { |name|
78
- proc { Rake.application[name] }.should raise_error(/Don't know how to build task/)
78
+ expect { Rake.application[name] }.to raise_error(/Don't know how to build task/)
79
79
  }
80
80
 
81
81
  @helper.install
82
82
 
83
83
  names.each { |name|
84
- proc { Rake.application[name] }.should_not raise_error
85
- Rake.application[name].should be_instance_of Rake::Task
84
+ expect { Rake.application[name] }.not_to raise_error
85
+ expect(Rake.application[name]).to be_instance_of Rake::Task
86
86
  }
87
87
  end
88
88
 
89
89
  it "provides a way to access the gemspec object" do
90
90
  @helper.install
91
- Bundler::GemHelper.gemspec.name.should == 'test'
91
+ expect(Bundler::GemHelper.gemspec.name).to eq('test')
92
92
  end
93
93
  end
94
94
 
@@ -96,23 +96,23 @@ describe "Bundler::GemHelper tasks" do
96
96
  it "builds" do
97
97
  mock_build_message
98
98
  @helper.build_gem
99
- bundled_app('test/pkg/test-0.0.1.gem').should exist
99
+ expect(bundled_app('test/pkg/test-0.0.1.gem')).to exist
100
100
  end
101
101
 
102
102
  it "raises an appropriate error when the build fails" do
103
103
  # break the gemspec by adding back the TODOs...
104
104
  File.open("#{@app.to_s}/test.gemspec", 'w'){|f| f << @gemspec }
105
- proc { @helper.build_gem }.should raise_error(/TODO/)
105
+ expect { @helper.build_gem }.to raise_error(/TODO/)
106
106
  end
107
107
  end
108
108
 
109
109
  describe 'install' do
110
110
  it "installs" do
111
111
  mock_build_message
112
- mock_confirm_message "test (0.0.1) installed"
112
+ mock_confirm_message "test (0.0.1) installed."
113
113
  @helper.install_gem
114
- bundled_app('test/pkg/test-0.0.1.gem').should exist
115
- %x{gem list}.should include("test (0.0.1)")
114
+ expect(bundled_app('test/pkg/test-0.0.1.gem')).to exist
115
+ expect(%x{gem list}).to include("test (0.0.1)")
116
116
  end
117
117
 
118
118
  it "raises an appropriate error when the install fails" do
@@ -123,13 +123,13 @@ describe "Bundler::GemHelper tasks" do
123
123
  File.open(path, 'w'){|f| f << "not actually a gem"}
124
124
  path
125
125
  end
126
- proc { @helper.install_gem }.should raise_error
126
+ expect { @helper.install_gem }.to raise_error
127
127
  end
128
128
  end
129
129
 
130
130
  describe 'release' do
131
131
  it "shouldn't push if there are uncommitted files" do
132
- proc { @helper.release_gem }.should raise_error(/files that need to be committed/)
132
+ expect { @helper.release_gem }.to raise_error(/files that need to be committed/)
133
133
  end
134
134
 
135
135
  it 'raises an appropriate error if there is no git remote' do
@@ -145,13 +145,13 @@ describe "Bundler::GemHelper tasks" do
145
145
  `git commit -a -m "initial commit"`
146
146
  }
147
147
 
148
- proc { @helper.release_gem }.should raise_error
148
+ expect { @helper.release_gem }.to raise_error
149
149
  end
150
150
 
151
151
  it "releases" do
152
152
  mock_build_message
153
153
  mock_confirm_message(/Tagged v0.0.1/)
154
- mock_confirm_message("Pushed git commits and tags")
154
+ mock_confirm_message("Pushed git commits and tags.")
155
155
 
156
156
  @helper.should_receive(:rubygem_push).with(bundled_app('test/pkg/test-0.0.1.gem').to_s)
157
157
 
@@ -169,6 +169,23 @@ describe "Bundler::GemHelper tasks" do
169
169
  }
170
170
  @helper.release_gem
171
171
  end
172
+
173
+ it "releases even if tag already exists" do
174
+ mock_build_message
175
+ mock_confirm_message("Tag v0.0.1 has already been created.")
176
+
177
+ @helper.should_receive(:rubygem_push).with(bundled_app('test/pkg/test-0.0.1.gem').to_s)
178
+
179
+ Dir.chdir(gem_repo1) {
180
+ `git init --bare`
181
+ }
182
+ Dir.chdir(@app) {
183
+ `git commit -a -m "another commit"`
184
+ `git tag -a -m \"Version 0.0.1\" v0.0.1`
185
+ }
186
+ @helper.release_gem
187
+ end
188
+
172
189
  end
173
190
  end
174
191
  end
@@ -1,4 +1,5 @@
1
1
  require 'spec_helper'
2
+ require 'bundler/psyched_yaml'
2
3
 
3
4
  describe Bundler::YamlSyntaxError do
4
5
  it "is raised on YAML parse errors" do
@@ -7,18 +7,18 @@ describe Bundler::Source::Rubygems do
7
7
 
8
8
  describe "caches" do
9
9
  it "should include Bundler.app_cache" do
10
- subject.caches.should include(Bundler.app_cache)
10
+ expect(subject.caches).to include(Bundler.app_cache)
11
11
  end
12
12
 
13
13
  it "should include GEM_PATH entries" do
14
14
  Gem.path.each do |path|
15
- subject.caches.should include(File.expand_path("#{path}/cache"))
15
+ expect(subject.caches).to include(File.expand_path("#{path}/cache"))
16
16
  end
17
17
  end
18
18
 
19
19
  it "should be an array of strings or pathnames" do
20
20
  subject.caches.each do |cache|
21
- [String, Pathname].should include(cache.class)
21
+ expect([String, Pathname]).to include(cache.class)
22
22
  end
23
23
  end
24
24
  end
@@ -13,7 +13,7 @@ describe "bundle cache" do
13
13
  end
14
14
 
15
15
  it "copies the .gem file to vendor/cache" do
16
- bundled_app("vendor/cache/rack-1.0.0.gem").should exist
16
+ expect(bundled_app("vendor/cache/rack-1.0.0.gem")).to exist
17
17
  end
18
18
 
19
19
  it "uses the cache as a source when installing gems" do
@@ -70,7 +70,7 @@ describe "bundle cache" do
70
70
 
71
71
  bundle "cache"
72
72
 
73
- bundled_app("Gemfile.lock").should exist
73
+ expect(bundled_app("Gemfile.lock")).to exist
74
74
  end
75
75
  end
76
76
 
@@ -102,7 +102,7 @@ describe "bundle cache" do
102
102
 
103
103
  bundle :cache
104
104
 
105
- bundled_app("Gemfile.lock").should exist
105
+ expect(bundled_app("Gemfile.lock")).to exist
106
106
  end
107
107
  end
108
108
 
@@ -115,23 +115,23 @@ describe "bundle cache" do
115
115
  gem "actionpack"
116
116
  G
117
117
  bundle :cache
118
- cached_gem("rack-1.0.0").should exist
119
- cached_gem("actionpack-2.3.2").should exist
120
- cached_gem("activesupport-2.3.2").should exist
118
+ expect(cached_gem("rack-1.0.0")).to exist
119
+ expect(cached_gem("actionpack-2.3.2")).to exist
120
+ expect(cached_gem("activesupport-2.3.2")).to exist
121
121
  end
122
122
 
123
123
  it "re-caches during install" do
124
124
  cached_gem("rack-1.0.0").rmtree
125
125
  bundle :install
126
- out.should include("Updating files in vendor/cache")
127
- cached_gem("rack-1.0.0").should exist
126
+ expect(out).to include("Updating files in vendor/cache")
127
+ expect(cached_gem("rack-1.0.0")).to exist
128
128
  end
129
129
 
130
130
  it "adds and removes when gems are updated" do
131
131
  update_repo2
132
132
  bundle 'update'
133
- cached_gem("rack-1.2").should exist
134
- cached_gem("rack-1.0.0").should_not exist
133
+ expect(cached_gem("rack-1.2")).to exist
134
+ expect(cached_gem("rack-1.0.0")).not_to exist
135
135
  end
136
136
 
137
137
  it "adds new gems and dependencies" do
@@ -139,8 +139,8 @@ describe "bundle cache" do
139
139
  source "file://#{gem_repo2}"
140
140
  gem "rails"
141
141
  G
142
- cached_gem("rails-2.3.2").should exist
143
- cached_gem("activerecord-2.3.2").should exist
142
+ expect(cached_gem("rails-2.3.2")).to exist
143
+ expect(cached_gem("activerecord-2.3.2")).to exist
144
144
  end
145
145
 
146
146
  it "removes .gems for removed gems and dependencies" do
@@ -148,9 +148,9 @@ describe "bundle cache" do
148
148
  source "file://#{gem_repo2}"
149
149
  gem "rack"
150
150
  G
151
- cached_gem("rack-1.0.0").should exist
152
- cached_gem("actionpack-2.3.2").should_not exist
153
- cached_gem("activesupport-2.3.2").should_not exist
151
+ expect(cached_gem("rack-1.0.0")).to exist
152
+ expect(cached_gem("actionpack-2.3.2")).not_to exist
153
+ expect(cached_gem("activesupport-2.3.2")).not_to exist
154
154
  end
155
155
 
156
156
  it "removes .gems when gem changes to git source" do
@@ -161,9 +161,9 @@ describe "bundle cache" do
161
161
  gem "rack", :git => "#{lib_path("rack-1.0")}"
162
162
  gem "actionpack"
163
163
  G
164
- cached_gem("rack-1.0.0").should_not exist
165
- cached_gem("actionpack-2.3.2").should exist
166
- cached_gem("activesupport-2.3.2").should exist
164
+ expect(cached_gem("rack-1.0.0")).not_to exist
165
+ expect(cached_gem("actionpack-2.3.2")).to exist
166
+ expect(cached_gem("activesupport-2.3.2")).to exist
167
167
  end
168
168
 
169
169
 
@@ -175,7 +175,7 @@ describe "bundle cache" do
175
175
  G
176
176
 
177
177
  bundle :cache
178
- cached_gem("platform_specific-1.0-java").should exist
178
+ expect(cached_gem("platform_specific-1.0-java")).to exist
179
179
  end
180
180
 
181
181
  simulate_new_machine
@@ -184,8 +184,8 @@ describe "bundle cache" do
184
184
  gem "platform_specific"
185
185
  G
186
186
 
187
- cached_gem("platform_specific-1.0-#{Gem::Platform.local}").should exist
188
- cached_gem("platform_specific-1.0-java").should exist
187
+ expect(cached_gem("platform_specific-1.0-#{Gem::Platform.local}")).to exist
188
+ expect(cached_gem("platform_specific-1.0-java")).to exist
189
189
  end
190
190
 
191
191
  it "doesn't remove gems with mismatched :rubygems_version or :date" do
@@ -196,7 +196,7 @@ describe "bundle cache" do
196
196
  simulate_new_machine
197
197
 
198
198
  bundle :install
199
- cached_gem("rack-1.0.0").should exist
199
+ expect(cached_gem("rack-1.0.0")).to exist
200
200
  end
201
201
 
202
202
  it "handles directories and non .gem files in the cache" do
@@ -212,7 +212,7 @@ describe "bundle cache" do
212
212
  G
213
213
  bundle "cache"
214
214
  bundle "install"
215
- out.should_not =~ /removing/i
215
+ expect(out).not_to match(/removing/i)
216
216
  end
217
217
 
218
218
  it "does not warn about all if it doesn't have any git/path dependency" do
@@ -221,7 +221,7 @@ describe "bundle cache" do
221
221
  gem "rack"
222
222
  G
223
223
  bundle "cache"
224
- out.should_not =~ /\-\-all/
224
+ expect(out).not_to match(/\-\-all/)
225
225
  end
226
226
 
227
227
  it "should install gems with the name bundler in them (that aren't bundler)" do