Sha256: 15a13aab2484f313118062fc954d625b797d599d526951982261bb1ca815b851
Contents?: true
Size: 1.11 KB
Versions: 12
Compression:
Stored size: 1.11 KB
Contents
RSPEC_EXPECTATION_NOT_MET_ERROR = RSpec::Expectations::ExpectationNotMetError Then /^the following steps? should (fail|succeed):$/ do |expectation, steps_table| steps = steps_table.raw.flatten steps.each do |step| if expectation == 'fail' expect { step(step) }.to raise_error(RSPEC_EXPECTATION_NOT_MET_ERROR) else # succeed step(step) end end end When /^I run the following steps?:$/ do |steps_table| steps = steps_table.raw.flatten steps.each do |step| step(step) end end Then /^the following multiline step should (fail|succeed):$/ do |expectation, multiline_step| multiline_step = multiline_step.gsub(%{'''}, %{"""}) if expectation == 'fail' expect { steps(multiline_step) }.to raise_error(RSPEC_EXPECTATION_NOT_MET_ERROR) else # succeed steps(multiline_step) end end Then(/^a hidden string with quotes should not be visible$/) do hidden_string = %Q{hidden '" quotes} assert_hidden(:text => hidden_string) end Then(/^a visible string with quotes should be visible$/) do visible_string = %Q{visible '" quotes} assert_visible(:text => visible_string) end
Version data entries
12 entries across 7 versions & 1 rubygems