diff options
Diffstat (limited to 'spec/bundler/other/ext_spec.rb')
-rw-r--r-- | spec/bundler/other/ext_spec.rb | 28 |
1 files changed, 26 insertions, 2 deletions
diff --git a/spec/bundler/other/ext_spec.rb b/spec/bundler/other/ext_spec.rb index e13f62a856..4d954b474f 100644 --- a/spec/bundler/other/ext_spec.rb +++ b/spec/bundler/other/ext_spec.rb @@ -44,6 +44,10 @@ RSpec.describe "Bundler::GemHelpers#generic" do expect(generic(pl("x64-mingw32"))).to eq(pl("x64-mingw32")) expect(generic(pl("x86_64-mingw32"))).to eq(pl("x64-mingw32")) end + + it "converts 64-bit mingw UCRT platform variants into x64-mingw-ucrt" do + expect(generic(pl("x64-mingw-ucrt"))).to eq(pl("x64-mingw-ucrt")) + end end RSpec.describe "Gem::SourceIndex#refresh!" do @@ -55,7 +59,27 @@ RSpec.describe "Gem::SourceIndex#refresh!" do end it "does not explode when called" do - run "Gem.source_index.refresh!", :raise_on_error => false - run "Gem::SourceIndex.new([]).refresh!", :raise_on_error => false + run "Gem.source_index.refresh!", raise_on_error: false + run "Gem::SourceIndex.new([]).refresh!", raise_on_error: false + end +end + +RSpec.describe "Gem::NameTuple" do + describe "#initialize" do + it "creates a Gem::NameTuple with equality regardless of platform type" do + gem_platform = Gem::NameTuple.new "a", v("1"), pl("x86_64-linux") + str_platform = Gem::NameTuple.new "a", v("1"), "x86_64-linux" + expect(gem_platform).to eq(str_platform) + expect(gem_platform.hash).to eq(str_platform.hash) + expect(gem_platform.to_a).to eq(str_platform.to_a) + end + end + + describe "#lock_name" do + it "returns the lock name" do + expect(Gem::NameTuple.new("a", v("1.0.0"), pl("x86_64-linux")).lock_name).to eq("a (1.0.0-x86_64-linux)") + expect(Gem::NameTuple.new("a", v("1.0.0"), "ruby").lock_name).to eq("a (1.0.0)") + expect(Gem::NameTuple.new("a", v("1.0.0")).lock_name).to eq("a (1.0.0)") + end end end |