dchelimsky (owner)

Fork Of

Revisions

gist: 159174 Download_button fork
public
Public Clone URL: git://gist.github.com/159174.git
Embed All Files: show embed
ExampleGroup level api #
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
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
 
 
ZZ - Crazy Example level api #
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
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