Skip to content
This repository has been archived by the owner on Apr 14, 2021. It is now read-only.

Commit

Permalink
Fix tests, address concerns
Browse files Browse the repository at this point in the history
  • Loading branch information
jules2689 committed May 3, 2017
1 parent 126ab5d commit f771cf5
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 8 deletions.
4 changes: 0 additions & 4 deletions lib/bundler/stub_specification.rb
Original file line number Diff line number Diff line change
Expand Up @@ -87,10 +87,6 @@ def raw_require_paths
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}" \
Expand Down
11 changes: 7 additions & 4 deletions spec/bundler/stub_specification_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,16 @@

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
Expand Down

0 comments on commit f771cf5

Please sign in to comment.