spec/macros4cuke/macro-step_spec.rb in macros4cuke-0.5.15 vs spec/macros4cuke/macro-step_spec.rb in macros4cuke-0.5.16
- old
+ new
@@ -58,23 +58,23 @@
it 'should know its key' do
expect(subject.key).to eq('enter_my_credentials_as_X_T')
end
it 'should know the tags(placeholders) from its phrase' do
- expect(subject.phrase_args).to eq(%w(userid))
+ expect(subject.phrase_args).to eq(%w[userid])
end
it 'should know the tags(placeholders) from its phrase and template' do
- expect(subject.args).to eq(%w(userid password))
+ expect(subject.args).to eq(%w[userid password])
end
end # context
context 'Provided services:' do
let(:phrase_instance) { 'enter my credentials as "nobody"' }
it 'should render the substeps' do
- text = subject.expand(phrase_instance, [ %w(password no-secret) ])
+ text = subject.expand(phrase_instance, [ %w[password no-secret] ])
expectation = <<-SNIPPET
Given I landed in the homepage
When I click "Sign in"
And I fill in "Username" with "nobody"
And I fill in "Password" with "no-secret"
@@ -98,11 +98,11 @@
expect(text).to eq(expectation)
end
it 'should un-escape the double-quotes for phrase arguments' do
specific_phrase = 'enter my credentials as "quotable\""'
- text = subject.expand(specific_phrase, [ %w(password no-secret) ])
+ text = subject.expand(specific_phrase, [ %w[password no-secret] ])
expectation = <<-SNIPPET
Given I landed in the homepage
When I click "Sign in"
And I fill in "Username" with "quotable""
And I fill in "Password" with "no-secret"
@@ -115,20 +115,20 @@
it 'should complain when an unknown variable is used' do
# Error case: there is no macro argument called <unknown>
exc = UnknownArgumentError
msg = "Unknown macro-step argument 'unknown'."
- args = [ %w(unknown anything) ]
+ args = [ %w[unknown anything] ]
expect { subject.expand(phrase_instance, args) }.to raise_error(exc, msg)
end
it 'should complain when argument gets a value from phrase and table' do
# Error case: there is no macro argument called <unknown>
phrase = 'enter my credentials as "nobody"'
exc = AmbiguousArgumentValue
msg = "The macro argument 'userid' has value 'nobody' and 'someone'."
- args = [ %w(userid someone), %w(password no-secret) ]
+ args = [ %w[userid someone], %w[password no-secret] ]
expect { subject.expand(phrase, args) }.to raise_error(exc, msg)
end
it 'should expand built-in variables' do