Skip to content

Instantly share code, notes, and snippets.

@dchelimsky
Forked from btakita/ExampleGroup level api
Created July 31, 2009 10:35
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dchelimsky/159174 to your computer and use it in GitHub Desktop.
Save dchelimsky/159174 to your computer and use it in GitHub Desktop.
Scenario "has three steps" do
Given "one" do
end
When "two" do
end
Then "three" do
end
end
Scenario "defines macros inline" do
# This defines a step named "this step with"
Given "this step with", "foo" do |arg|
arg.should == "foo"
end
# This invokes the "this step with" step with the arg "bar" (and consequently fails)
Given "this step with", "bar"
end
describe "normal scenario" do
series "three steps" do
step "one" do
:foo.should == :foo
a { :foo == :foo }
:foo.should_not == :bar
a { :foo != :bar }
a { :foo }.must be :foo
a { :foo }.must_not be :bar
a { :foo }.must == :bar
an { Einstein.new }.must be :smart?
end
step "two" do
a {1}.to be(1)
a {1 == 1}
end
step "three" do
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment