cukesalad 0.3.0 → 0.4.0
Sign up to get free protection for your applications and to get access to all the features.
- data/Examples/Calculator/Gemfile +1 -0
- data/Examples/Calculator/Gemfile.lock +9 -0
- data/Examples/Calculator/features/support/env.rb +0 -1
- data/README.md +9 -20
- data/VERSION +1 -1
- data/bin/cukesalad +44 -11
- data/examples/Calculator/features/support/env.rb +0 -1
- metadata +3 -3
data/Examples/Calculator/Gemfile
CHANGED
@@ -1,6 +1,10 @@
|
|
1
1
|
GEM
|
2
2
|
remote: http://rubygems.org/
|
3
3
|
specs:
|
4
|
+
aruba (0.3.5)
|
5
|
+
childprocess (>= 0.1.7)
|
6
|
+
cucumber (>= 0.10.0)
|
7
|
+
rspec (>= 2.5.0)
|
4
8
|
builder (3.0.0)
|
5
9
|
capybara (0.4.1.2)
|
6
10
|
celerity (>= 0.7.9)
|
@@ -20,6 +24,10 @@ GEM
|
|
20
24
|
gherkin (~> 2.3.2)
|
21
25
|
json (~> 1.4.6)
|
22
26
|
term-ansicolor (~> 1.0.5)
|
27
|
+
cukesalad (0.3.0)
|
28
|
+
aruba (= 0.3.5)
|
29
|
+
cucumber (= 0.10.0)
|
30
|
+
rspec (= 2.5.0)
|
23
31
|
culerity (0.2.15)
|
24
32
|
diff-lcs (1.1.2)
|
25
33
|
ffi (1.0.7)
|
@@ -62,5 +70,6 @@ PLATFORMS
|
|
62
70
|
DEPENDENCIES
|
63
71
|
capybara (= 0.4.1.2)
|
64
72
|
cucumber (= 0.10.0)
|
73
|
+
cukesalad (>= 0.3.0)
|
65
74
|
rspec (= 2.5.0)
|
66
75
|
sinatra (= 1.2.0)
|
data/README.md
CHANGED
@@ -36,23 +36,13 @@ Let's see how this works with a simple example...
|
|
36
36
|
|
37
37
|
## Let's Get started
|
38
38
|
|
39
|
-
Create a new project Calculator:
|
39
|
+
Create a new project called Calculator:
|
40
40
|
|
41
|
-
|
42
|
-
cd Calculator
|
43
|
-
mkdir features
|
44
|
-
mkdir features/support
|
45
|
-
mkdir features/lib
|
46
|
-
mkdir features/lib/tasks
|
47
|
-
mkdir features/lib/roles
|
41
|
+
cukesalad Calculator
|
48
42
|
|
49
|
-
|
43
|
+
Or, if you have an existing cucumber project that you want to configure to use cukesalad, you can type:
|
50
44
|
|
51
|
-
|
52
|
-
begin require 'rspec/expectations'; rescue LoadError; require 'spec/expectations'; end
|
53
|
-
|
54
|
-
Cucumber will automatically find our project's _roles_ and _tasks_, as it loads
|
55
|
-
all .rb files beneath the project's `features/` directory.
|
45
|
+
cukesalad
|
56
46
|
|
57
47
|
## Write Features
|
58
48
|
|
@@ -75,8 +65,7 @@ Let's take a moment to understand this scenario:
|
|
75
65
|
When I attempt to <do some task>
|
76
66
|
Then I should <ask some question> '<expected answer>'
|
77
67
|
|
78
|
-
To get this working, we don't need to write any steps.
|
79
|
-
Just explain how to do the _task_ using a class...
|
68
|
+
To get this working, we don't need to write any steps. Instead, we describe tasks...
|
80
69
|
|
81
70
|
## Create Tasks
|
82
71
|
|
@@ -85,14 +74,14 @@ Create a new file, `features/lib/tasks/switch_on_the_calculator.rb`
|
|
85
74
|
|
86
75
|
Remember the step `When I attempt to switch on the calculator`
|
87
76
|
|
88
|
-
in_order_to "
|
77
|
+
in_order_to "switch on the calculator" do
|
89
78
|
@calc = switch_on_the_calculator
|
90
79
|
end
|
91
80
|
|
92
81
|
Remember the step `Then I should see the answer '0'`
|
93
82
|
Now we need `task/see_the_answer.rb`
|
94
83
|
|
95
|
-
in_order_to "
|
84
|
+
in_order_to "see the answer" do
|
96
85
|
look_at_the_display
|
97
86
|
end
|
98
87
|
|
@@ -146,7 +135,7 @@ You can have as many name-value pairs as you like.
|
|
146
135
|
|
147
136
|
So, we need a task called `tasks/add.rb` that explains the individual actions required to complete the task:
|
148
137
|
|
149
|
-
in_order_to "
|
138
|
+
in_order_to "add" do
|
150
139
|
enter @value_of(:the_number)
|
151
140
|
press :plus
|
152
141
|
enter @value_of(:to_the_number)
|
@@ -157,7 +146,7 @@ Notice how the `value_of` lines use symbols that correspond to the wording `'the
|
|
157
146
|
|
158
147
|
There is some 'syntactic sugar' that we can use to dress this up a little and make it read nicer... a simple attribute mapping:
|
159
148
|
|
160
|
-
in_order_to "
|
149
|
+
in_order_to "add", the_number: :first_number, to_the_number: :second_number do
|
161
150
|
enter the :first_number
|
162
151
|
press :plus
|
163
152
|
enter the :second_number
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.
|
1
|
+
0.4.0
|
data/bin/cukesalad
CHANGED
@@ -1,10 +1,10 @@
|
|
1
1
|
#!/usr/bin/env ruby
|
2
|
-
|
3
2
|
require 'optparse'
|
4
3
|
require 'cukesalad/cli'
|
4
|
+
CONFIRMATION = 'y'
|
5
5
|
|
6
6
|
OptionParser.new do |opts|
|
7
|
-
opts.banner = "Usage: cukesalad
|
7
|
+
opts.banner = "Usage: cukesalad or cukesalad project"
|
8
8
|
|
9
9
|
begin
|
10
10
|
opts.parse!(ARGV)
|
@@ -15,14 +15,47 @@ OptionParser.new do |opts|
|
|
15
15
|
end
|
16
16
|
end
|
17
17
|
|
18
|
+
def user_confirm_setup? project
|
19
|
+
puts %Q|About to set-up project '#{project}' and configure cukesalad
|
20
|
+
The following project structure will be created:
|
21
|
+
#{project}
|
22
|
+
#{project}/features
|
23
|
+
#{project}/features/tasks
|
24
|
+
#{project}/features/roles
|
25
|
+
#{project}/features/support
|
26
|
+
#{project}/features/support/env.rb
|
27
|
+
Continue (y/n)?|
|
28
|
+
user_confirmed?
|
29
|
+
end
|
30
|
+
|
31
|
+
def user_confirm_configuration?
|
32
|
+
puts %Q|About to set-up your current project to work with cukesalad
|
33
|
+
The following files will be created/modified:
|
34
|
+
features
|
35
|
+
features/tasks
|
36
|
+
features/roles
|
37
|
+
features/support
|
38
|
+
features/support/env.rb
|
39
|
+
Continue (y/n)?|
|
40
|
+
user_confirmed?
|
41
|
+
end
|
42
|
+
|
43
|
+
def user_confirmed?
|
44
|
+
STDIN.gets.chomp == CONFIRMATION
|
45
|
+
end
|
46
|
+
|
18
47
|
if ARGV.empty?
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
48
|
+
if user_confirm_configuration?
|
49
|
+
CukeSalad::CLI.configure_existing_project
|
50
|
+
else
|
51
|
+
abort "User aborted"
|
52
|
+
end
|
53
|
+
elsif ARGV.first
|
54
|
+
project = ARGV[0]
|
55
|
+
if user_confirm_setup? project
|
56
|
+
CukeSalad::CLI.create_new_project project
|
57
|
+
else
|
58
|
+
abort "User aborted"
|
59
|
+
end
|
28
60
|
end
|
61
|
+
|
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.4.0
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
8
8
|
- RiverGlide
|
@@ -10,7 +10,7 @@ autorequire:
|
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
12
|
|
13
|
-
date: 2011-04-
|
13
|
+
date: 2011-04-21 00:00:00 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: cucumber
|
@@ -165,7 +165,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
165
165
|
requirements:
|
166
166
|
- - ">="
|
167
167
|
- !ruby/object:Gem::Version
|
168
|
-
hash:
|
168
|
+
hash: 2646953412636943422
|
169
169
|
segments:
|
170
170
|
- 0
|
171
171
|
version: "0"
|