Skip to content
This repository has been archived by the owner on Jun 23, 2020. It is now read-only.

Commit

Permalink
Add spec testing multiple package prefixes
Browse files Browse the repository at this point in the history
  • Loading branch information
movitto committed May 28, 2014
1 parent 79693db commit e7db296
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions spec/koji_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,25 @@ module Polisher
described_class.versions_for 'rails'
end

it "handles multiple koji prefixes" do
@prefix = ['rubygem-', 'ruby193-rubygem-']
described_class.should_receive(:package_prefix).twice.and_return(['rubygem-', 'ruby193-rubygem-'])
described_class.should_receive(:koji_tags).and_return(['tag1', 'tag2'])
expected1 = ['listTagged', 'tag1', nil, true,
nil, false, "rubygem-rails"]
expected2 = ['listTagged', 'tag2', nil, true,
nil, false, "rubygem-rails"]
expected3 = ['listTagged', 'tag1', nil, true,
nil, false, "ruby193-rubygem-rails"]
expected4 = ['listTagged', 'tag2', nil, true,
nil, false, "ruby193-rubygem-rails"]
@client.should_receive(:call).with(*expected1).and_return([])
@client.should_receive(:call).with(*expected2).and_return([])
@client.should_receive(:call).with(*expected3).and_return([])
@client.should_receive(:call).with(*expected4).and_return([])
described_class.versions_for 'rails'
end

it "returns versions" do
versions = [{'version' => '1.0.0'}]
@client.should_receive(:call).and_return(versions)
Expand Down

0 comments on commit e7db296

Please sign in to comment.