Logo: Relish

  1. Sign in

Project: Shokkenki-consumer 1.2

Defining consumer contexts

Consumer RSpec contexts need to be identified to Shokkenki by including :shokkenki_consumer in their metadata. This allows Shokkenki to weave its magic at the appropriate times as the specs are run.

Defining a context as a :shokkenki_consumer will cause Shokkenki to use the context name as the consumer label. You can also specify a custom consumer label in the metadata.

Scenarios
Context name is used as the consumer name and label
Given
a configuration exists that defines the provider "my_provider"
And
a file named "spec/spec.rb" with:
describe 'Greeting Consumer', :shokkenki_consumer do
  it 'is greeted' {}
end
When
I run rspec
Then
a ticket should exist with:
consumer.label Greeting Consumer
Consumer label is specified
Given
a configuration exists that defines the provider "my_provider"
And
a file named "spec/spec.rb" with:
describe 'Greeting Consumer', :shokkenki_consumer => 'My Consumer' do
  it 'is greeted' {}
end
When
I run rspec
Then
a ticket should exist with:
consumer.label My Consumer

Last published about 5 years ago by brentsnook.