thoughtworks/pacto — pull request #25 by taisediass (2013-09-20 22:44:39+00:00)
Title: Pacto tag support

As a testing using Pacto
I want Pacto to support tags
So I can easily load and register groups of contracts

Scenario: Defaults
Given I have run this code to register contracts:
```ruby

Pacto.register 'create_item_legacy', :item, :legacy

Pacto.register do |r|
r.register_contract 'new_api/create_item_v2', :item, :new
r.register_contract 'authentication', :default
r.register_contract 'list_items_legacy', :legacy
r.register_contract 'get_item_legacy', :legacy
end
```
When I use a tag to load the contracts:
```ruby
Pacto.use 'whatever'
```
Then Pacto should load the follow contracts for use:
* authentication

Scenario: Using a tag
Given I have run this code to register contracts:
```ruby
Pacto.configure do |c|
c.register_contract 'create_item_legacy', :item, :legacy
c.register_contract 'new_api/create_item_v2', :item, :new
c.register_contract 'authentication', :default
c.register_contract 'list_items_legacy', :legacy
c.register_contract 'get_item_legacy', :legacy
end
```
When I use a tag to load the contracts:
```ruby
Pacto.use 'legacy'
```
Then Pacto should load the follow contracts for use:
* authentication
* list_items_legacy
* get_item_legacy