rspec-given 1.2.0 → 1.3.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -26,7 +26,7 @@ describe Stack do
26
26
 
27
27
  Then { stack.depth.should == 0 }
28
28
 
29
- context "Pushing onto an empty stack" do
29
+ Scenario "pushing onto an empty stack" do
30
30
  When { stack.push(:an_item) }
31
31
 
32
32
  Then { stack.depth.should == 1 }
@@ -37,7 +37,7 @@ describe Stack do
37
37
  context "a stack with one item do" do
38
38
  Given(:stack) { a_stack_with_one_item }
39
39
 
40
- context "popping an item empties the stack" do
40
+ Scenario "popping an item empties the stack" do
41
41
  When(:pop_result) { stack.pop }
42
42
 
43
43
  Then { pop_result.should == :an_item }
@@ -49,14 +49,14 @@ describe Stack do
49
49
  Given(:stack) { a_stack_with_several_items }
50
50
  Given!(:original_depth) { stack.depth }
51
51
 
52
- context "pushing a new item adds a new top" do
52
+ Scenario "pushing a new item adds a new top" do
53
53
  When { stack.push(:new_item) }
54
54
 
55
55
  Then { stack.top.should == :new_item }
56
56
  Then { stack.depth.should == original_depth + 1 }
57
57
  end
58
58
 
59
- context "popping an item removes the top item" do
59
+ Scenario "popping an item removes the top item" do
60
60
  When(:pop_result) { stack.pop }
61
61
 
62
62
  Then { pop_result.should == :top_item }
@@ -2,6 +2,20 @@ module RSpec
2
2
  module Given
3
3
  module Extensions
4
4
 
5
+ # Declare a scenario to contain Given/When/Then declarations. A
6
+ # Scenario is essentially an RSpec context, with the additional
7
+ # expectations:
8
+ #
9
+ # * There is a single When declaration in a Scenario.
10
+ # * Scenarios do not nest.
11
+ #
12
+ # :call-seq:
13
+ # Scenario "a scenario description" do ... end
14
+ #
15
+ def Scenario(description, &block)
16
+ context(description, &block)
17
+ end
18
+
5
19
  # Declare a "given" of the current specification. If the given
6
20
  # is named, the block will be lazily evaluated the first time
7
21
  # the given is mentioned by name in the specification. If the
@@ -1,7 +1,7 @@
1
1
  module RSpec
2
2
  module Given
3
3
  VERSION_MAJOR = 1
4
- VERSION_MINOR = 2
4
+ VERSION_MINOR = 3
5
5
  VERSION_BUILD = 0
6
6
  VERSION_NUMBERS = [VERSION_MAJOR, VERSION_MINOR, VERSION_BUILD]
7
7
  VERSION = VERSION_NUMBERS.join(".")
metadata CHANGED
@@ -4,9 +4,9 @@ version: !ruby/object:Gem::Version
4
4
  prerelease: false
5
5
  segments:
6
6
  - 1
7
- - 2
7
+ - 3
8
8
  - 0
9
- version: 1.2.0
9
+ version: 1.3.0
10
10
  platform: ruby
11
11
  authors:
12
12
  - Jim Weirich
@@ -14,7 +14,7 @@ autorequire:
14
14
  bindir: bin
15
15
  cert_chain: []
16
16
 
17
- date: 2010-11-28 00:00:00 -05:00
17
+ date: 2010-12-07 00:00:00 -05:00
18
18
  default_executable:
19
19
  dependencies:
20
20
  - !ruby/object:Gem::Dependency