bdd 0.0.4 → 0.0.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +47 -2
- data/lib/bdd/rspec/example_group.rb +9 -0
- data/lib/bdd/rspec.rb +3 -0
- data/lib/bdd/version.rb +1 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6b8ca14ed7de7bc6f6934c847c4c75d15e515d56
|
4
|
+
data.tar.gz: 9484550bd54749dc0b97b4fc952b930298fcd4e9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
-
|
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
data/lib/bdd/version.rb
CHANGED
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
|
+
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-
|
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:
|