-
-
Notifications
You must be signed in to change notification settings - Fork 178
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: parse pacts for verification selectors to Selector class
- Loading branch information
Showing
9 changed files
with
68 additions
and
31 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
require 'pact_broker/pacts/selector' | ||
|
||
module PactBroker | ||
module Pacts | ||
describe Selector do | ||
describe "<=>" do | ||
let(:overall_latest_1) { Selector.overall_latest } | ||
let(:overall_latest_2) { Selector.overall_latest } | ||
let(:latest_for_tag_prod) { Selector.latest_for_tag('prod') } | ||
let(:latest_for_tag_dev) { Selector.latest_for_tag('dev') } | ||
let(:all_prod) { Selector.all_for_tag('prod') } | ||
let(:all_dev) { Selector.all_for_tag('dev') } | ||
|
||
let(:unsorted_selectors) do | ||
[all_prod, all_dev, latest_for_tag_prod, overall_latest_1, overall_latest_1, latest_for_tag_dev] | ||
end | ||
|
||
let(:expected_sorted_selectors) do | ||
[overall_latest_1, overall_latest_1, latest_for_tag_dev, latest_for_tag_prod, all_dev, all_prod] | ||
end | ||
|
||
it "sorts the selectors" do | ||
expect(unsorted_selectors.sort).to eq(expected_sorted_selectors) | ||
end | ||
end | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters