spec/gemirro/source_spec.rb in gemirro-0.11.0 vs spec/gemirro/source_spec.rb in gemirro-0.12.0
- old
+ new
@@ -6,10 +6,11 @@
# Source tests
module Gemirro
describe 'Source' do
before(:each) do
@source = Source.new('RubyGems', 'https://rubygems.org')
+ allow(@source.logger).to receive(:info)
end
it 'should be initialized' do
expect(@source.name).to eq('rubygems')
expect(@source.host).to eq('https://rubygems.org')
@@ -21,9 +22,18 @@
result = Struct::FetchVersions.new(true)
allow(Http).to receive(:get).once.with(
"https://rubygems.org/#{Configuration.versions_file}"
).and_return(result)
expect(@source.fetch_versions).to be_truthy
+ end
+
+ it 'should fetch prereleases versions' do
+ Struct.new('FetchPrereleaseVersions', :body)
+ result = Struct::FetchPrereleaseVersions.new(true)
+ allow(Http).to receive(:get).once.with(
+ "https://rubygems.org/#{Configuration.prerelease_versions_file}"
+ ).and_return(result)
+ expect(@source.fetch_prerelease_versions).to be_truthy
end
it 'should fetch gem' do
Struct.new('FetchGem', :body)
result = Struct::FetchGem.new(true)