GWT?
Given
[I'm hungry]
When
[I eat]
Then
[I feel better]
looks like Finite State Machine
Initial State + Event => New State
Given
[I'm hungry]
When
[I drink]
Then
[I do not feel better]
Two fold
-
behavior in plain text using "natural" language
-
each GWT sentence MUST have its implementation
describe "hungry man" do
let(:hungry) {Human.new(hungry: true)}
it "should feel better after eating something" do
hungry.eat!.should be_feel_better
end
end
Cavalle :
-
An argument in favor of Cucumber I've never seen mentioned: Apparently clients and managers love it
feature "Main page" do
background do create_user :login => "jdoe" login_as "jdoe" end scenario "should show existing quotes" do create_quote :text => "The language of friendship is not words, but meanings", :author => "Henry David Thoreau" visit "/" page.should have_css(".quote", :count => 1) within(:css, ".quote") do page.should have_css(".text", :text => "The language of friendship is not words, but meanings") page.should have_css(".author", :text => "Henry David Thoreau") end end
end