Skip to content

Commit

Permalink
Refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
lovro-bikic committed Oct 24, 2024
1 parent ae1d2c5 commit 57f0f2f
Showing 1 changed file with 11 additions and 5 deletions.
16 changes: 11 additions & 5 deletions spec/lib/polariscope/scanner/gem_versions_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,20 @@
end

describe '#versions_for' do
let(:dependencies) { ['devise', 'rails'] }

before { allow(Polariscope::Scanner::RubyVersions).to receive(:available_versions) }

it 'returns only distinct versions for given gem name' do
expect(scanner.versions_for('devise').map(&:to_s)).to contain_exactly('4.6.2', '4.5.0')
context 'when ruby is not in dependencies' do
let(:dependencies) { ['devise', 'rails'] }

it 'returns distinct versions for given gem name' do
expect(scanner.versions_for('devise').map(&:to_s)).to contain_exactly('4.6.2', '4.5.0')
end

it "doesn't fetch ruby versions" do
scanner

expect(Polariscope::Scanner::RubyVersions).not_to have_received(:available_versions)
expect(Polariscope::Scanner::RubyVersions).not_to have_received(:available_versions)
end
end

context 'when ruby is in dependencies' do
Expand Down

0 comments on commit 57f0f2f

Please sign in to comment.