after(:${each}) do
${cursor}
endat_least(:once)at_least(:twice)at_most(:once)at_most(:twice)any_number_of_timesand_raise(${exception})and_return(${value})and_return { ${block} }and_throw(${sym})and_yield(${values})at_least(${n}).timesat_most(${n}).timesbefore(:${each}) do
${cursor}
enddescribe "${description1}" do
it "should ${description2}" do
${cursor}
end
endrequire File.dirname(__FILE__) + '/../spec_helper'
describe ${controller} do
${cursor}
end
enddescribe ${controller}, "${GET_POST_PUT_DELETE} ${some_path} ${with_some_parameters}" do
${cursor}
enddescribe ${type} do
it "should ${description}" do
${cursor}
end
enddescribe ${type}, "${description1}" do
it "should ${description2}" do
${cursor}
end
endexactly(${n}).timesit "${should} ${description}" do
${cursor}
endclass ${ReverseTo}
def initialize(${var})
@${var} = ${var}
end
def matches?(actual)
@actual = actual
# Satisfy expectation here. Return false or raise an error if it's not met.
@actual.reverse.should == @${var}
true
end
def failure_message
"expected #{@actual.inspect} to ${counter} #{@${var}.inspect}, but it didn't"
end
def negative_failure_message
"expected #{@actual.inspect} not to ${counter} #{@${var}.inspect}, but it did"
end
end
def ${reverse_to}(${expected})
${ReverseTo}.new(${var})
end${var} = mock("${mock_name}" ${options})
${cursor}oncerequire File.dirname(__FILE__) + '/../spec_helper'Scenario "${title}" do
Given "${given}"
When "${when}"
Then "${then}"
end${target}.should == ${value}
${cursor}${target}.should be(${result})
${cursor}${target}.should be_close(${result}, ${tolerance})
${cursor}${target}.should be_instance_of(${class})
${cursor}${target}.should be_a_kind_of(${class})
${cursor}response.should be_redirect
${cursor}response.should be_success
${cursor}${target}.should eql(${value})
${cursor}${target}.should equal(${value})
${cursor}${target}.should have(${num}).${things}
${cursor}${target}.should have_at_least(${num}).${things}
${cursor}${target}.should have_at_most(${num}).${things}
${cursor}${target}.should have(${x}).records
${cursor}${target}.should include(${value})
${cursor}${target}.should =~ /${regexp}/
${cursor}${target}.should match(/${regexp}/)
${cursor}${target}.should_not == ${value}
${cursor}${target}.should_not be(${result})
${cursor}${target}.should_not be_close(${result}, ${tolerance})
${cursor}${target}.should_not be_instance_of(${class})
${cursor}${target}.should_not be_a_kind_of(${class})
${cursor}response.should_not be_redirect
${cursor}response.should_not be_success
${cursor}${target}.should_not eql(${value})
${cursor}${target}.should_not equal(${value})
${cursor}${target}.should_not include(${value})
${cursor}${target}.should_not =~ /${regexp}/
${cursor}${target}.should_not match(/${regexp}/)
${cursor}${target}.should_not ${be_}${predicate} ${args}
${cursor}${mock}.should_not_receive(:${message})${extras}
${cursor}lambda { ${do_something_risky} }.should_not raise_error(${error})
${cursor}${target}.should_not respond_to(:${sym})
${cursor}${target}.should_not satisfy { |obj| ${conditions} }
${cursor}lambda { ${do_something_risky} }.should_not throw_symbol(:${symbol})
${cursor}${target}.should ${be_}${predicate} ${args}
${cursor}${mock}.should_receive(:${message})${extras}
${cursor}lambda { ${do_something_risky} }.should raise_error(${error})
${cursor}response.should redirect_to(${url})
${cursor}response.should render_template(:${template})
${cursor}${target}.should respond_to(:${sym})
${cursor}${target}.should satisfy { |obj| ${conditions} }
${cursor}lambda { ${do_something_risky} }.should throw_symbol(:${symbol})
${cursor}Story "${title}", %{
As a ${role}
I want ${feature}
So that ${value}
} do
endtwicewith(${args})
${cursor}