|
88 | 88 | describe "with --require" do |
89 | 89 | it "adds the require param for the gem" do |
90 | 90 | bundle "add 'foo' --require=foo/engine" |
91 | | - expect(bundled_app_gemfile.read).to match(%r{gem "foo",(?: .*,) :require => "foo\/engine"}) |
| 91 | + expect(bundled_app_gemfile.read).to match(%r{gem "foo",(?: .*,) require: "foo\/engine"}) |
92 | 92 | end |
93 | 93 |
|
94 | 94 | it "converts false to a boolean" do |
95 | 95 | bundle "add 'foo' --require=false" |
96 | | - expect(bundled_app_gemfile.read).to match(/gem "foo",(?: .*,) :require => false/) |
| 96 | + expect(bundled_app_gemfile.read).to match(/gem "foo",(?: .*,) require: false/) |
97 | 97 | end |
98 | 98 | end |
99 | 99 |
|
100 | 100 | describe "with --group" do |
101 | 101 | it "adds dependency for the specified group" do |
102 | 102 | bundle "add 'foo' --group='development'" |
103 | | - expect(bundled_app_gemfile.read).to match(/gem "foo", "~> 2.0", :group => :development/) |
| 103 | + expect(bundled_app_gemfile.read).to match(/gem "foo", "~> 2.0", group: :development/) |
104 | 104 | expect(the_bundle).to include_gems "foo 2.0" |
105 | 105 | end |
106 | 106 |
|
107 | 107 | it "adds dependency to more than one group" do |
108 | 108 | bundle "add 'foo' --group='development, test'" |
109 | | - expect(bundled_app_gemfile.read).to match(/gem "foo", "~> 2.0", :groups => \[:development, :test\]/) |
| 109 | + expect(bundled_app_gemfile.read).to match(/gem "foo", "~> 2.0", groups: \[:development, :test\]/) |
110 | 110 | expect(the_bundle).to include_gems "foo 2.0" |
111 | 111 | end |
112 | 112 | end |
|
115 | 115 | it "adds dependency with specified source" do |
116 | 116 | bundle "add 'foo' --source='https://gem.repo2'" |
117 | 117 |
|
118 | | - expect(bundled_app_gemfile.read).to match(%r{gem "foo", "~> 2.0", :source => "https://gem.repo2"}) |
| 118 | + expect(bundled_app_gemfile.read).to match(%r{gem "foo", "~> 2.0", source: "https://gem.repo2"}) |
119 | 119 | expect(the_bundle).to include_gems "foo 2.0" |
120 | 120 | end |
121 | 121 | end |
|
124 | 124 | it "adds dependency with specified path" do |
125 | 125 | bundle "add 'foo' --path='#{lib_path("foo-2.0")}'" |
126 | 126 |
|
127 | | - expect(bundled_app_gemfile.read).to match(/gem "foo", "~> 2.0", :path => "#{lib_path("foo-2.0")}"/) |
| 127 | + expect(bundled_app_gemfile.read).to match(/gem "foo", "~> 2.0", path: "#{lib_path("foo-2.0")}"/) |
128 | 128 | expect(the_bundle).to include_gems "foo 2.0" |
129 | 129 | end |
130 | 130 | end |
|
133 | 133 | it "adds dependency with specified git source" do |
134 | 134 | bundle "add foo --git=#{lib_path("foo-2.0")}" |
135 | 135 |
|
136 | | - expect(bundled_app_gemfile.read).to match(/gem "foo", "~> 2.0", :git => "#{lib_path("foo-2.0")}"/) |
| 136 | + expect(bundled_app_gemfile.read).to match(/gem "foo", "~> 2.0", git: "#{lib_path("foo-2.0")}"/) |
137 | 137 | expect(the_bundle).to include_gems "foo 2.0" |
138 | 138 | end |
139 | 139 | end |
|
146 | 146 | it "adds dependency with specified git source and branch" do |
147 | 147 | bundle "add foo --git=#{lib_path("foo-2.0")} --branch=test" |
148 | 148 |
|
149 | | - expect(bundled_app_gemfile.read).to match(/gem "foo", "~> 2.0", :git => "#{lib_path("foo-2.0")}", :branch => "test"/) |
| 149 | + expect(bundled_app_gemfile.read).to match(/gem "foo", "~> 2.0", git: "#{lib_path("foo-2.0")}", branch: "test"/) |
150 | 150 | expect(the_bundle).to include_gems "foo 2.0" |
151 | 151 | end |
152 | 152 | end |
|
155 | 155 | it "adds dependency with specified git source and branch" do |
156 | 156 | bundle "add foo --git=#{lib_path("foo-2.0")} --ref=#{revision_for(lib_path("foo-2.0"))}" |
157 | 157 |
|
158 | | - expect(bundled_app_gemfile.read).to match(/gem "foo", "~> 2\.0", :git => "#{lib_path("foo-2.0")}", :ref => "#{revision_for(lib_path("foo-2.0"))}"/) |
| 158 | + expect(bundled_app_gemfile.read).to match(/gem "foo", "~> 2\.0", git: "#{lib_path("foo-2.0")}", ref: "#{revision_for(lib_path("foo-2.0"))}"/) |
159 | 159 | expect(the_bundle).to include_gems "foo 2.0" |
160 | 160 | end |
161 | 161 | end |
|
164 | 164 | it "adds dependency with specified github source" do |
165 | 165 | bundle "add rake --github=ruby/rake" |
166 | 166 |
|
167 | | - expect(bundled_app_gemfile.read).to match(%r{gem "rake", "~> 13\.\d+", :github => "ruby\/rake"}) |
| 167 | + expect(bundled_app_gemfile.read).to match(%r{gem "rake", "~> 13\.\d+", github: "ruby\/rake"}) |
168 | 168 | end |
169 | 169 | end |
170 | 170 |
|
171 | 171 | describe "with --github and --branch" do |
172 | 172 | it "adds dependency with specified github source and branch" do |
173 | 173 | bundle "add rake --github=ruby/rake --branch=master" |
174 | 174 |
|
175 | | - expect(bundled_app_gemfile.read).to match(%r{gem "rake", "~> 13\.\d+", :github => "ruby\/rake", :branch => "master"}) |
| 175 | + expect(bundled_app_gemfile.read).to match(%r{gem "rake", "~> 13\.\d+", github: "ruby\/rake", branch: "master"}) |
176 | 176 | end |
177 | 177 | end |
178 | 178 |
|
179 | 179 | describe "with --github and --ref" do |
180 | 180 | it "adds dependency with specified github source and ref" do |
181 | 181 | bundle "add rake --github=ruby/rake --ref=5c60da8" |
182 | 182 |
|
183 | | - expect(bundled_app_gemfile.read).to match(%r{gem "rake", "~> 13\.\d+", :github => "ruby\/rake", :ref => "5c60da8"}) |
| 183 | + expect(bundled_app_gemfile.read).to match(%r{gem "rake", "~> 13\.\d+", github: "ruby\/rake", ref: "5c60da8"}) |
184 | 184 | end |
185 | 185 | end |
186 | 186 |
|
187 | 187 | describe "with --git and --glob" do |
188 | 188 | it "adds dependency with specified git source" do |
189 | 189 | bundle "add foo --git=#{lib_path("foo-2.0")} --glob='./*.gemspec'" |
190 | 190 |
|
191 | | - expect(bundled_app_gemfile.read).to match(%r{gem "foo", "~> 2.0", :git => "#{lib_path("foo-2.0")}", :glob => "\./\*\.gemspec"}) |
| 191 | + expect(bundled_app_gemfile.read).to match(%r{gem "foo", "~> 2.0", git: "#{lib_path("foo-2.0")}", glob: "\./\*\.gemspec"}) |
192 | 192 | expect(the_bundle).to include_gems "foo 2.0" |
193 | 193 | end |
194 | 194 | end |
|
201 | 201 | it "adds dependency with specified git source and branch" do |
202 | 202 | bundle "add foo --git=#{lib_path("foo-2.0")} --branch=test --glob='./*.gemspec'" |
203 | 203 |
|
204 | | - expect(bundled_app_gemfile.read).to match(%r{gem "foo", "~> 2.0", :git => "#{lib_path("foo-2.0")}", :branch => "test", :glob => "\./\*\.gemspec"}) |
| 204 | + expect(bundled_app_gemfile.read).to match(%r{gem "foo", "~> 2.0", git: "#{lib_path("foo-2.0")}", branch: "test", glob: "\./\*\.gemspec"}) |
205 | 205 | expect(the_bundle).to include_gems "foo 2.0" |
206 | 206 | end |
207 | 207 | end |
|
210 | 210 | it "adds dependency with specified git source and branch" do |
211 | 211 | bundle "add foo --git=#{lib_path("foo-2.0")} --ref=#{revision_for(lib_path("foo-2.0"))} --glob='./*.gemspec'" |
212 | 212 |
|
213 | | - expect(bundled_app_gemfile.read).to match(%r{gem "foo", "~> 2\.0", :git => "#{lib_path("foo-2.0")}", :ref => "#{revision_for(lib_path("foo-2.0"))}", :glob => "\./\*\.gemspec"}) |
| 213 | + expect(bundled_app_gemfile.read).to match(%r{gem "foo", "~> 2\.0", git: "#{lib_path("foo-2.0")}", ref: "#{revision_for(lib_path("foo-2.0"))}", glob: "\./\*\.gemspec"}) |
214 | 214 | expect(the_bundle).to include_gems "foo 2.0" |
215 | 215 | end |
216 | 216 | end |
|
219 | 219 | it "adds dependency with specified github source" do |
220 | 220 | bundle "add rake --github=ruby/rake --glob='./*.gemspec'" |
221 | 221 |
|
222 | | - expect(bundled_app_gemfile.read).to match(%r{gem "rake", "~> 13\.\d+", :github => "ruby\/rake", :glob => "\.\/\*\.gemspec"}) |
| 222 | + expect(bundled_app_gemfile.read).to match(%r{gem "rake", "~> 13\.\d+", github: "ruby\/rake", glob: "\.\/\*\.gemspec"}) |
223 | 223 | end |
224 | 224 | end |
225 | 225 |
|
226 | 226 | describe "with --github and --branch --and glob" do |
227 | 227 | it "adds dependency with specified github source and branch" do |
228 | 228 | bundle "add rake --github=ruby/rake --branch=master --glob='./*.gemspec'" |
229 | 229 |
|
230 | | - expect(bundled_app_gemfile.read).to match(%r{gem "rake", "~> 13\.\d+", :github => "ruby\/rake", :branch => "master", :glob => "\.\/\*\.gemspec"}) |
| 230 | + expect(bundled_app_gemfile.read).to match(%r{gem "rake", "~> 13\.\d+", github: "ruby\/rake", branch: "master", glob: "\.\/\*\.gemspec"}) |
231 | 231 | end |
232 | 232 | end |
233 | 233 |
|
234 | 234 | describe "with --github and --ref and --glob" do |
235 | 235 | it "adds dependency with specified github source and ref" do |
236 | 236 | bundle "add rake --github=ruby/rake --ref=5c60da8 --glob='./*.gemspec'" |
237 | 237 |
|
238 | | - expect(bundled_app_gemfile.read).to match(%r{gem "rake", "~> 13\.\d+", :github => "ruby\/rake", :ref => "5c60da8", :glob => "\.\/\*\.gemspec"}) |
| 238 | + expect(bundled_app_gemfile.read).to match(%r{gem "rake", "~> 13\.\d+", github: "ruby\/rake", ref: "5c60da8", glob: "\.\/\*\.gemspec"}) |
239 | 239 | end |
240 | 240 | end |
241 | 241 |
|
|
250 | 250 |
|
251 | 251 | it "using combination of short form options works like long form" do |
252 | 252 | bundle "add 'foo' -s='https://gem.repo2' -g='development' -v='~>1.0'" |
253 | | - expect(bundled_app_gemfile.read).to include %(gem "foo", "~> 1.0", :group => :development, :source => "https://gem.repo2") |
| 253 | + expect(bundled_app_gemfile.read).to include %(gem "foo", "~> 1.0", group: :development, source: "https://gem.repo2") |
254 | 254 | expect(the_bundle).to include_gems "foo 1.1" |
255 | 255 | end |
256 | 256 |
|
|
0 commit comments