diff options
author | Julian Nadeau <julian@jnadeau.ca> | 2017-05-02 22:18:52 -0400 |
---|---|---|
committer | Julian Nadeau <julian@jnadeau.ca> | 2017-05-05 10:04:10 -0400 |
commit | c049b09f8167a9a80a9a91c56bbd72aee40c0095 (patch) | |
tree | 94be288de115d221d1c669941a2cd074fe1aea21 | |
parent | 51623aae48bdf0365d577c6d9d4e1930ba328180 (diff) | |
download | bundler-c049b09f8167a9a80a9a91c56bbd72aee40c0095.tar.gz |
Fix tests, address concerns
-rw-r--r-- | lib/bundler/stub_specification.rb | 4 | ||||
-rw-r--r-- | spec/bundler/stub_specification_spec.rb | 11 |
2 files changed, 7 insertions, 8 deletions
diff --git a/lib/bundler/stub_specification.rb b/lib/bundler/stub_specification.rb index aeacf245a3..562a58d39f 100644 --- a/lib/bundler/stub_specification.rb +++ b/lib/bundler/stub_specification.rb @@ -87,10 +87,6 @@ module Bundler def _remote_specification @_remote_specification ||= begin rs = stub.to_spec - if rs.equal?(self) # happens when to_spec gets the spec from Gem.loaded_specs - rs = Gem::Specification.load(loaded_from) - Bundler.rubygems.stub_set_spec(stub, rs) - end unless rs raise GemspecError, "The gemspec for #{full_name} at #{loaded_from}" \ diff --git a/spec/bundler/stub_specification_spec.rb b/spec/bundler/stub_specification_spec.rb index ecfe2412ee..2d3970a6a0 100644 --- a/spec/bundler/stub_specification_spec.rb +++ b/spec/bundler/stub_specification_spec.rb @@ -3,13 +3,16 @@ require "spec_helper" if Bundler.rubygems.provides?(">= 2.1") RSpec.describe Bundler::StubSpecification do - let(:with_gem_stub_spec) do - stub = Gem::Specification.stubs.first - described_class.from_stub(stub) + let(:gemspec) do + Gem::Specification.new do |s| + s.name = "gemname" + s.version = "1.0.0" + s.loaded_from = __FILE__ + end end let(:with_bundler_stub_spec) do - described_class.from_stub(with_gem_stub_spec) + described_class.from_stub(gemspec) end describe "#from_stub" do |