Skip to content

Commit dd473ce

Browse files
soda92matzbot
authored andcommitted
[rubygems/rubygems] Fix binstub test bug
the overwritten binstub in the test has a final new line that makes it not match "OMG" exactly from the beginning, that's why the test passes, but `bintubs` command without `--force` flag is not supposed to update the binstub. This change fixes the test to test what's supposed to update the binstub, and also fixes the assertion that that it will fail in the future if `--force` stops updating the binstub. ruby/rubygems@dfc9023337
1 parent 492b379 commit dd473ce

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

spec/bundler/runtime/executable_spec.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -126,17 +126,17 @@
126126
expect(bundled_app("bin/myrackup")).to exist
127127
end
128128

129-
it "rewrites bins on binstubs (to maintain backwards compatibility)" do
129+
it "rewrites bins on binstubs with --force option" do
130130
install_gemfile <<-G
131131
source "https://gem.repo1"
132132
gem "myrack"
133133
G
134134

135135
create_file("bin/myrackup", "OMG")
136136

137-
bundle "binstubs myrack"
137+
bundle "binstubs myrack", { force: true }
138138

139-
expect(bundled_app("bin/myrackup").read).to_not eq("OMG")
139+
expect(bundled_app("bin/myrackup").read.strip).to_not eq("OMG")
140140
end
141141

142142
it "use BUNDLE_GEMFILE gemfile for binstub" do

0 commit comments

Comments
 (0)