bdd 0.0.4 → 0.0.5

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: cbc92a0c8782e9974981c74890dea36d220410c3
4
- data.tar.gz: 024305cd3b3cacc85e01d3640410aa2144281786
3
+ metadata.gz: 6b8ca14ed7de7bc6f6934c847c4c75d15e515d56
4
+ data.tar.gz: 9484550bd54749dc0b97b4fc952b930298fcd4e9
5
5
  SHA512:
6
- metadata.gz: 1d6f5ebc9288be3d2e31bc8fc54903dd33617d3ccbe868491e1215ddbd257e49dc22517864b213edbcea93ec813683254a757a555f45af5f83e4f5bc3dc01a01
7
- data.tar.gz: 792d9fd642291bdc205b7649fdfe224391c28195c04c830dc1fd97dd91d4896fdb358801d239261436a30e1fc5b58bd43401a5bb1b2319898d05db5ef4c206d6
6
+ metadata.gz: a72765cb181d7da429f54bebfcacee64358fb63f3c4ef5d3ac4559ac5d182350584f2a58b5213886b25ca10d7c4ed6a98fd7f1f0dfb830dd44ec387318c7560e
7
+ data.tar.gz: c77adb5a01809d7c2ad2b9bb23ed2059694e4f851742f2336454a598519cf61aac4c61464eb64762356e55742d8529333be7eca1489505121c1941f3d4277d6c
data/README.md CHANGED
@@ -89,7 +89,6 @@ end
89
89
  </pre>
90
90
 
91
91
 
92
-
93
92
  ### Shared Steps
94
93
 
95
94
  ### Basic Example with shared steps
@@ -141,7 +140,53 @@ Output:
141
140
  </pre>
142
141
 
143
142
 
144
- ### Nested Example with shared steps
143
+
144
+ ### Nested Example 1
145
+
146
+ Outside of the scope
147
+
148
+ Given is automatically inserted as a before
149
+ Then is automatically inserted as an after
150
+
151
+ ```ruby
152
+ Given "I log in" do
153
+ visit '/login'
154
+ fill_in 'Login', with: 'jack@example.com'
155
+ fill_in 'Password', with: 'password'
156
+ click_button "Log in"
157
+ expect(page).to have_content('Welcome jack@example.com')
158
+ end
159
+
160
+ Then "I should see a confirmation message" do
161
+ expect(page).to have_content('Your profile was updated successfully')
162
+ end
163
+
164
+ context 'User Flow' do
165
+ it 'User updates profile description' do
166
+ When 'I update profile description' do
167
+ ...
168
+ end
169
+ end
170
+
171
+ it 'User updates profile avatar' do
172
+ When 'I update profile avatar' do
173
+ ...
174
+ end
175
+ end
176
+ end
177
+ ```
178
+ Output:
179
+ <pre>
180
+ <b>User Flow</b>
181
+ <b>User updates profile description</b>
182
+ <b>Given</b> I log in
183
+ <b> When</b> I update profile description
184
+ <b> Then</b> I should see a confirmation message
185
+ </pre>
186
+
187
+
188
+
189
+ ### Nested Example 2
145
190
 
146
191
  Nesting will silence any output from the internal steps
147
192
 
@@ -73,6 +73,15 @@ module Bdd
73
73
  # step(" But Then #{msg}", &block)
74
74
  # end
75
75
 
76
+ module ClassMethods
77
+ def Given(msg, &block)
78
+ before(:each) { Given(msg, &block) }
79
+ end
80
+
81
+ def Then(msg, &block)
82
+ after(:each) { Then(msg, &block) }
83
+ end
84
+ end
76
85
 
77
86
  private
78
87
 
data/lib/bdd/rspec.rb CHANGED
@@ -1,3 +1,6 @@
1
1
  require 'bdd/rspec/example_group'
2
2
 
3
3
  RSpec::Core::ExampleGroup.send :include, Bdd::RSpec::ExampleGroup
4
+
5
+ RSpec::Core::ExampleGroup.send :extend, Bdd::RSpec::ExampleGroup::ClassMethods
6
+
data/lib/bdd/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Bdd
2
- VERSION = "0.0.4"
2
+ VERSION = "0.0.5"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bdd
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.4
4
+ version: 0.0.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - James Pinto
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2015-09-07 00:00:00.000000000 Z
11
+ date: 2015-11-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rspec
@@ -84,3 +84,4 @@ signing_key:
84
84
  specification_version: 4
85
85
  summary: Cucumber style in your RSpec tests
86
86
  test_files: []
87
+ has_rdoc: