|
438 | 438 | expect(err).to include("You have changed in the Gemfile:\n* myrack from `no specified source` to `git://hubz.com`") |
439 | 439 | end |
440 | 440 |
|
441 | | - it "explodes if you change a source" do |
| 441 | + it "explodes if you change a source from git to the default" do |
442 | 442 | build_git "myrack" |
443 | 443 |
|
444 | 444 | install_gemfile <<-G |
|
459 | 459 | expect(err).to include("You have changed in the Gemfile:\n* myrack from `#{lib_path("myrack-1.0")}` to `no specified source`") |
460 | 460 | end |
461 | 461 |
|
462 | | - it "explodes if you change a source" do |
| 462 | + it "explodes if you change a source from git to the default, in presence of other git sources" do |
463 | 463 | build_lib "foo", path: lib_path("myrack/foo") |
464 | 464 | build_git "myrack", path: lib_path("myrack") |
465 | 465 |
|
|
483 | 483 | expect(err).not_to include("You have deleted from the Gemfile") |
484 | 484 | end |
485 | 485 |
|
| 486 | + it "explodes if you change a source from path to git" do |
| 487 | + build_git "myrack", path: lib_path("myrack") |
| 488 | + |
| 489 | + install_gemfile <<-G |
| 490 | + source "https://gem.repo1" |
| 491 | + gem "myrack", :path => "#{lib_path("myrack")}" |
| 492 | + G |
| 493 | + |
| 494 | + gemfile <<-G |
| 495 | + source "https://gem.repo1" |
| 496 | + gem "myrack", :git => "https:/my-git-repo-for-myrack" |
| 497 | + G |
| 498 | + |
| 499 | + bundle "config set --local frozen true" |
| 500 | + bundle :install, raise_on_error: false |
| 501 | + expect(err).to include("frozen mode") |
| 502 | + expect(err).to include("You have changed in the Gemfile:\n* myrack from `#{lib_path("myrack")}` to `https:/my-git-repo-for-myrack`") |
| 503 | + expect(err).not_to include("You have added to the Gemfile") |
| 504 | + expect(err).not_to include("You have deleted from the Gemfile") |
| 505 | + end |
| 506 | + |
486 | 507 | it "remembers that the bundle is frozen at runtime" do |
487 | 508 | bundle :lock |
488 | 509 |
|
|
0 commit comments