cukesalad 0.7.0 → 0.8.0
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.
- data/Examples/Calculator/Gemfile +4 -0
- data/Examples/Calculator/Gemfile.lock +36 -20
- data/Examples/Calculator/README.md +7 -0
- data/Examples/Calculator/cucumber.yml +1 -1
- data/Examples/Calculator/features/addition.feature +1 -1
- data/Examples/Calculator/features/lib/{alternative → browser}/roles/calculating_web_user.rb +1 -1
- data/Examples/Calculator/features/lib/default/roles/calculating_individual.rb +3 -5
- data/Examples/Calculator/features/lib/default/tasks/reference/calculations.rb +4 -2
- data/Examples/Calculator/features/subtraction.feature +1 -1
- data/Examples/Calculator/lib/calculator_operations.rb +4 -0
- data/Examples/Calculator/lib/web_calculator.rb +17 -20
- data/Examples/Calculator/views/index.erb +7 -0
- data/Examples/Calculator/views/layout.erb +2 -0
- data/Gemfile.lock +12 -12
- data/VERSION +1 -1
- data/cukesalad.gemspec +2 -2
- data/features/README.markdown +39 -273
- data/features/a_simple_tutorial/README.markdown +277 -0
- data/features/creating_a_new_project.feature +24 -22
- data/features/defining_roles/README.md +29 -0
- data/features/{define_a_role.feature → defining_roles/define_a_role.feature} +8 -0
- data/features/{prepare_the_actor_for_the_role.feature → defining_roles/prepare_the_actor_for_the_role.feature} +0 -0
- data/features/defining_tasks/README.md +12 -0
- data/features/{define_a_task.feature → defining_tasks/define_a_task.feature} +58 -17
- data/features/{define_a_task_with_arguments.feature → defining_tasks/define_a_task_with_arguments.feature} +0 -0
- data/features/{remember_information_between_steps.feature → defining_tasks/remember_information_between_steps.feature} +0 -0
- data/features/expectations/README.md +21 -0
- data/features/{expressing_expectations.feature → expectations/expressing_expectations.feature} +0 -0
- data/features/lib/tasks/interactively_run.rb +5 -0
- data/features/lib/tasks/see_the_step_has.rb +1 -1
- data/lib/cukesalad/actor.rb +5 -5
- data/lib/cukesalad/cli.rb +1 -1
- data/lib/cukesalad/cucumber_steps.rb +3 -7
- data/lib/cukesalad/specifics.rb +3 -3
- data/lib/cukesalad/version.rb +1 -1
- data/spec/cukesalad/cli_spec.rb +1 -1
- metadata +35 -24
File without changes
|
File without changes
|
@@ -0,0 +1,21 @@
|
|
1
|
+
In your scenario, you'll want to express expectations in a number of forms.
|
2
|
+
|
3
|
+
The most comprehensive representation of the various ways you can express expectations is in the full set of cukesalad features.
|
4
|
+
|
5
|
+
The most basic is as follows:
|
6
|
+
|
7
|
+
Then I should see the answer '10'
|
8
|
+
|
9
|
+
For this to work, you need a task that returns a value.
|
10
|
+
|
11
|
+
in_order_to "see the answer" do
|
12
|
+
look_at_the_display
|
13
|
+
end
|
14
|
+
|
15
|
+
Your role will need a method called `look_at_the_display` that returns a value.
|
16
|
+
|
17
|
+
See the expectations examples for the fundamentals.
|
18
|
+
|
19
|
+
See the full set of cukesalad features for examples of the different forms your expectations can take.
|
20
|
+
|
21
|
+
All of the cukesalad features use cukesalad to test itself.
|
data/features/{expressing_expectations.feature → expectations/expressing_expectations.feature}
RENAMED
File without changes
|
data/lib/cukesalad/actor.rb
CHANGED
@@ -2,17 +2,17 @@ require 'cukesalad/director'
|
|
2
2
|
|
3
3
|
module CukeSalad
|
4
4
|
class Actor
|
5
|
-
|
5
|
+
|
6
6
|
def initialize this_type_of_role, directed_by=Director.new
|
7
7
|
@director = directed_by
|
8
8
|
@note_pad = {}
|
9
9
|
get_into_character_for this_type_of_role
|
10
10
|
end
|
11
|
-
|
11
|
+
|
12
12
|
def perform described_task, details = {}
|
13
13
|
get_ready_to_perform described_task
|
14
14
|
@info = details
|
15
|
-
perform_task
|
15
|
+
perform_task
|
16
16
|
end
|
17
17
|
alias :answer :perform
|
18
18
|
|
@@ -21,10 +21,10 @@ module CukeSalad
|
|
21
21
|
see_how_to_do the_role
|
22
22
|
role_preparation
|
23
23
|
end
|
24
|
-
|
24
|
+
|
25
25
|
def get_ready_to_perform something
|
26
26
|
the_thing = @director.how_do_i_perform something
|
27
|
-
see_how_to_do the_thing
|
27
|
+
see_how_to_do the_thing
|
28
28
|
end
|
29
29
|
|
30
30
|
def see_how_to_do something
|
data/lib/cukesalad/cli.rb
CHANGED
@@ -54,7 +54,7 @@ module CukeSalad
|
|
54
54
|
|
55
55
|
def configure
|
56
56
|
cd "features/support"
|
57
|
-
content = "
|
57
|
+
content = "\nrequire 'cukesalad'\nbegin require 'rspec/expectations'; rescue LoadError; require 'spec/expectations'; end"
|
58
58
|
append_to_file "env.rb",content
|
59
59
|
end
|
60
60
|
|
@@ -1,4 +1,4 @@
|
|
1
|
-
require 'cukesalad'
|
1
|
+
require 'cukesalad/salad'
|
2
2
|
|
3
3
|
def in_order_to(do_something, *with_attributes, &actions)
|
4
4
|
CukeSalad::TaskAuthor.in_order_to(do_something, *with_attributes, &actions)
|
@@ -7,15 +7,11 @@ end
|
|
7
7
|
World(CukeSalad::TaskAuthor)
|
8
8
|
World(CukeSalad::Specifics)
|
9
9
|
|
10
|
-
|
11
|
-
puts "CukeSalad says: Hello!!"
|
12
|
-
end
|
13
|
-
|
14
|
-
Given /^(?:I am|you are) a ([a-zA-Z ]+)$/ do |role|
|
10
|
+
Given /^(?:I am|you are) a(?:n)? ([a-zA-Z ]+)$/ do |role|
|
15
11
|
@actor = CukeSalad::Actor.new(role)
|
16
12
|
end
|
17
13
|
|
18
|
-
When /^(?:I|you
|
14
|
+
When /^(?:I (?!am)|you (?!are))(?:attempt to |was able to |were able to |did )?((?!should)[A-Z a-z\d_-]*)(?:[:|,] (.*))?:?$/ do | this_task, details, *and_more |
|
19
15
|
info = understand_the details unless details.nil?
|
20
16
|
info[info.keys.last] = and_more[0] unless and_more.empty?
|
21
17
|
@actor.perform this_task, info unless info.nil?
|
data/lib/cukesalad/specifics.rb
CHANGED
@@ -3,14 +3,14 @@ module CukeSalad
|
|
3
3
|
def understand_the details
|
4
4
|
@info = with_specifics_from( details )
|
5
5
|
end
|
6
|
-
|
6
|
+
|
7
7
|
def value_of(symbol)
|
8
8
|
@info[symbol]
|
9
9
|
end
|
10
10
|
|
11
11
|
def with_specifics_from details
|
12
12
|
result = {}
|
13
|
-
names_and_values_in(details).each_slice(2) do |name_value|
|
13
|
+
names_and_values_in(details).each_slice(2) do |name_value|
|
14
14
|
result[symbolized name_value[0]] = the_value_from_the name_value[1]
|
15
15
|
end
|
16
16
|
result
|
@@ -29,7 +29,7 @@ module CukeSalad
|
|
29
29
|
name.strip.gsub(' ', '_').to_sym
|
30
30
|
end
|
31
31
|
|
32
|
-
def the_value_from_the item
|
32
|
+
def the_value_from_the item
|
33
33
|
item.gsub(/((?:^'|'$)|(?:^"|"$))/, '') unless item.nil?
|
34
34
|
end
|
35
35
|
end
|
data/lib/cukesalad/version.rb
CHANGED
data/spec/cukesalad/cli_spec.rb
CHANGED
@@ -42,7 +42,7 @@ describe CukeSalad::CLI do
|
|
42
42
|
end
|
43
43
|
|
44
44
|
it 'env.rb has the right content' do
|
45
|
-
content = "
|
45
|
+
content = "\nrequire 'cukesalad'\nbegin require 'rspec/expectations'; rescue LoadError; require 'spec/expectations'; end"
|
46
46
|
file_content(file).should == content
|
47
47
|
end
|
48
48
|
end
|
metadata
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
name: cukesalad
|
3
3
|
version: !ruby/object:Gem::Version
|
4
4
|
prerelease:
|
5
|
-
version: 0.
|
5
|
+
version: 0.8.0
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
8
8
|
- RiverGlide
|
@@ -10,17 +10,16 @@ autorequire:
|
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
12
|
|
13
|
-
date: 2011-
|
14
|
-
default_executable: cukesalad
|
13
|
+
date: 2011-09-14 00:00:00 Z
|
15
14
|
dependencies:
|
16
15
|
- !ruby/object:Gem::Dependency
|
17
16
|
name: cucumber
|
18
17
|
requirement: &id001 !ruby/object:Gem::Requirement
|
19
18
|
none: false
|
20
19
|
requirements:
|
21
|
-
- - "
|
20
|
+
- - "="
|
22
21
|
- !ruby/object:Gem::Version
|
23
|
-
version: 0.
|
22
|
+
version: 1.0.2
|
24
23
|
type: :runtime
|
25
24
|
prerelease: false
|
26
25
|
version_requirements: *id001
|
@@ -40,9 +39,9 @@ dependencies:
|
|
40
39
|
requirement: &id003 !ruby/object:Gem::Requirement
|
41
40
|
none: false
|
42
41
|
requirements:
|
43
|
-
- - "
|
42
|
+
- - "="
|
44
43
|
- !ruby/object:Gem::Version
|
45
|
-
version: 0.3
|
44
|
+
version: 0.4.3
|
46
45
|
type: :runtime
|
47
46
|
prerelease: false
|
48
47
|
version_requirements: *id003
|
@@ -99,7 +98,7 @@ files:
|
|
99
98
|
- Examples/Calculator/features/a_place_to_start.feature
|
100
99
|
- Examples/Calculator/features/addition.feature
|
101
100
|
- Examples/Calculator/features/complex_calculations.feature
|
102
|
-
- Examples/Calculator/features/lib/
|
101
|
+
- Examples/Calculator/features/lib/browser/roles/calculating_web_user.rb
|
103
102
|
- Examples/Calculator/features/lib/default/roles/calculating_individual.rb
|
104
103
|
- Examples/Calculator/features/lib/default/tasks/arithmetic/add.rb
|
105
104
|
- Examples/Calculator/features/lib/default/tasks/arithmetic/calculate.rb
|
@@ -111,10 +110,13 @@ files:
|
|
111
110
|
- Examples/Calculator/features/support/env.rb
|
112
111
|
- Examples/Calculator/features/typical_workflow.feature
|
113
112
|
- Examples/Calculator/lib/calculator.rb
|
113
|
+
- Examples/Calculator/lib/calculator_operations.rb
|
114
114
|
- Examples/Calculator/lib/config.ru
|
115
115
|
- Examples/Calculator/lib/web_calculator.rb
|
116
116
|
- Examples/Calculator/spec/calculator_spec.rb
|
117
117
|
- Examples/Calculator/spec/web_calculator_spec.rb
|
118
|
+
- Examples/Calculator/views/index.erb
|
119
|
+
- Examples/Calculator/views/layout.erb
|
118
120
|
- Gemfile
|
119
121
|
- Gemfile.lock
|
120
122
|
- LICENSE
|
@@ -125,17 +127,24 @@ files:
|
|
125
127
|
- cucumber.yml
|
126
128
|
- cukesalad.gemspec
|
127
129
|
- features/README.markdown
|
130
|
+
- features/a_simple_tutorial/README.markdown
|
128
131
|
- features/creating_a_new_project.feature
|
129
|
-
- features/
|
130
|
-
- features/
|
131
|
-
- features/
|
132
|
-
- features/
|
132
|
+
- features/defining_roles/README.md
|
133
|
+
- features/defining_roles/define_a_role.feature
|
134
|
+
- features/defining_roles/prepare_the_actor_for_the_role.feature
|
135
|
+
- features/defining_tasks/README.md
|
136
|
+
- features/defining_tasks/define_a_task.feature
|
137
|
+
- features/defining_tasks/define_a_task_with_arguments.feature
|
138
|
+
- features/defining_tasks/remember_information_between_steps.feature
|
139
|
+
- features/expectations/README.md
|
140
|
+
- features/expectations/expressing_expectations.feature
|
133
141
|
- features/lib/roles/step_free_cuker.rb
|
134
142
|
- features/lib/tasks/create_a_file.rb
|
135
143
|
- features/lib/tasks/create_a_new_cukesalad_project.rb
|
136
144
|
- features/lib/tasks/create_a_role.rb
|
137
145
|
- features/lib/tasks/create_a_task.rb
|
138
146
|
- features/lib/tasks/create_directories.rb
|
147
|
+
- features/lib/tasks/interactively_run.rb
|
139
148
|
- features/lib/tasks/not_create_a_role.rb
|
140
149
|
- features/lib/tasks/not_create_a_task.rb
|
141
150
|
- features/lib/tasks/not_previously_take_note_of_something.rb
|
@@ -143,8 +152,6 @@ files:
|
|
143
152
|
- features/lib/tasks/run_a_scenario.rb
|
144
153
|
- features/lib/tasks/see_a_reply.rb
|
145
154
|
- features/lib/tasks/see_the_step_has.rb
|
146
|
-
- features/prepare_the_actor_for_the_role.feature
|
147
|
-
- features/remember_information_between_steps.feature
|
148
155
|
- features/support/env.rb
|
149
156
|
- lib/cukesalad.rb
|
150
157
|
- lib/cukesalad/actor.rb
|
@@ -163,7 +170,6 @@ files:
|
|
163
170
|
- spec/cukesalad/specifics_spec.rb
|
164
171
|
- spec/cukesalad/task_author_spec.rb
|
165
172
|
- spec/spec_helper.rb
|
166
|
-
has_rdoc: true
|
167
173
|
homepage: https://github.com/RiverGlide/CukeSalad
|
168
174
|
licenses:
|
169
175
|
- MIT
|
@@ -177,7 +183,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
177
183
|
requirements:
|
178
184
|
- - ">="
|
179
185
|
- !ruby/object:Gem::Version
|
180
|
-
hash:
|
186
|
+
hash: 2889682039650591259
|
181
187
|
segments:
|
182
188
|
- 0
|
183
189
|
version: "0"
|
@@ -186,30 +192,37 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
186
192
|
requirements:
|
187
193
|
- - ">="
|
188
194
|
- !ruby/object:Gem::Version
|
189
|
-
hash:
|
195
|
+
hash: 2889682039650591259
|
190
196
|
segments:
|
191
197
|
- 0
|
192
198
|
version: "0"
|
193
199
|
requirements: []
|
194
200
|
|
195
201
|
rubyforge_project:
|
196
|
-
rubygems_version: 1.
|
202
|
+
rubygems_version: 1.8.10
|
197
203
|
signing_key:
|
198
204
|
specification_version: 3
|
199
205
|
summary: Friction Free BDD/ATDD with cucumber
|
200
206
|
test_files:
|
201
207
|
- features/README.markdown
|
208
|
+
- features/a_simple_tutorial/README.markdown
|
202
209
|
- features/creating_a_new_project.feature
|
203
|
-
- features/
|
204
|
-
- features/
|
205
|
-
- features/
|
206
|
-
- features/
|
210
|
+
- features/defining_roles/README.md
|
211
|
+
- features/defining_roles/define_a_role.feature
|
212
|
+
- features/defining_roles/prepare_the_actor_for_the_role.feature
|
213
|
+
- features/defining_tasks/README.md
|
214
|
+
- features/defining_tasks/define_a_task.feature
|
215
|
+
- features/defining_tasks/define_a_task_with_arguments.feature
|
216
|
+
- features/defining_tasks/remember_information_between_steps.feature
|
217
|
+
- features/expectations/README.md
|
218
|
+
- features/expectations/expressing_expectations.feature
|
207
219
|
- features/lib/roles/step_free_cuker.rb
|
208
220
|
- features/lib/tasks/create_a_file.rb
|
209
221
|
- features/lib/tasks/create_a_new_cukesalad_project.rb
|
210
222
|
- features/lib/tasks/create_a_role.rb
|
211
223
|
- features/lib/tasks/create_a_task.rb
|
212
224
|
- features/lib/tasks/create_directories.rb
|
225
|
+
- features/lib/tasks/interactively_run.rb
|
213
226
|
- features/lib/tasks/not_create_a_role.rb
|
214
227
|
- features/lib/tasks/not_create_a_task.rb
|
215
228
|
- features/lib/tasks/not_previously_take_note_of_something.rb
|
@@ -217,8 +230,6 @@ test_files:
|
|
217
230
|
- features/lib/tasks/run_a_scenario.rb
|
218
231
|
- features/lib/tasks/see_a_reply.rb
|
219
232
|
- features/lib/tasks/see_the_step_has.rb
|
220
|
-
- features/prepare_the_actor_for_the_role.feature
|
221
|
-
- features/remember_information_between_steps.feature
|
222
233
|
- features/support/env.rb
|
223
234
|
- spec/cukesalad/actor_spec.rb
|
224
235
|
- spec/cukesalad/cli_spec.rb
|