cukesalad 0.6.0 → 0.6.1
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/.gitignore +15 -0
- data/Examples/Calculator/Gemfile +4 -5
- data/Examples/Calculator/Gemfile.lock +30 -33
- data/Examples/Calculator/features/lib/default/tasks/{add.rb → arithmetic/add.rb} +0 -0
- data/Examples/Calculator/features/lib/default/tasks/{calculate.rb → arithmetic/calculate.rb} +0 -0
- data/Examples/Calculator/features/lib/default/tasks/{subtract.rb → arithmetic/subtract.rb} +0 -0
- data/Examples/Calculator/features/lib/default/tasks/{see_the_answer.rb → questions/see_the_answer.rb} +0 -0
- data/Examples/Calculator/features/lib/default/tasks/{calculations.rb → reference/calculations.rb} +0 -0
- data/Gemfile +2 -7
- data/Gemfile.lock +29 -29
- data/Rakefile +1 -21
- data/cukesalad.gemspec +29 -0
- data/features/define_a_task.feature +17 -17
- data/features/remember_information_between_steps.feature +5 -5
- data/features/support/env.rb +0 -2
- data/lib/cukesalad.rb +2 -36
- data/lib/cukesalad/actor.rb +49 -0
- data/lib/cukesalad/codify/const_name.rb +23 -0
- data/lib/cukesalad/cucumber.rb +35 -0
- data/lib/cukesalad/director.rb +30 -0
- data/lib/cukesalad/salad.rb +3 -0
- data/lib/cukesalad/specifics.rb +36 -0
- data/lib/cukesalad/task_author.rb +21 -0
- data/lib/cukesalad/version.rb +3 -0
- data/spec/cukesalad/actor_spec.rb +96 -0
- data/spec/cukesalad/codify/as_const_name_spec.rb +30 -0
- data/spec/cukesalad/director_spec.rb +36 -0
- data/spec/cukesalad/specifics_spec.rb +68 -0
- data/spec/cukesalad/task_author_spec.rb +52 -0
- data/spec/spec_helper.rb +1 -4
- metadata +62 -59
- data/examples/Calculator/features/lib/alternative/roles/calculating_web_user.rb +0 -55
- data/examples/Calculator/features/lib/default/roles/calculating_individual.rb +0 -32
- data/examples/Calculator/features/lib/default/tasks/add.rb +0 -6
- data/examples/Calculator/features/lib/default/tasks/calculate.rb +0 -4
- data/examples/Calculator/features/lib/default/tasks/calculations.rb +0 -15
- data/examples/Calculator/features/lib/default/tasks/see_the_answer.rb +0 -3
- data/examples/Calculator/features/lib/default/tasks/subtract.rb +0 -4
- data/examples/Calculator/features/lib/default/tasks/switch_on_the_calculator.rb +0 -9
- data/examples/Calculator/features/support/env.rb +0 -5
- data/examples/Calculator/lib/calculator.rb +0 -53
- data/examples/Calculator/lib/web_calculator.rb +0 -82
- data/examples/Calculator/spec/calculator_spec.rb +0 -73
- data/examples/Calculator/spec/web_calculator_spec.rb +0 -99
- data/lib/actor.rb +0 -47
- data/lib/codify/const_name.rb +0 -21
- data/lib/director.rb +0 -28
- data/lib/specifics.rb +0 -34
- data/lib/task_author.rb +0 -12
- data/spec/actor_spec.rb +0 -96
- data/spec/codify/as_const_name_spec.rb +0 -28
- data/spec/director_spec.rb +0 -34
- data/spec/specifics_spec.rb +0 -67
- data/spec/task_author_spec.rb +0 -50
data/.gitignore
ADDED
data/Examples/Calculator/Gemfile
CHANGED
@@ -1,6 +1,5 @@
|
|
1
1
|
source :rubygems
|
2
|
-
gem "
|
3
|
-
gem "
|
4
|
-
gem "
|
5
|
-
gem "
|
6
|
-
gem "sinatra", "1.2.0"
|
2
|
+
gem "cukesalad", ">=0.6"
|
3
|
+
gem "rspec", ">=2.5.0", :require => 'spec'
|
4
|
+
gem "capybara", ">=0.4.1.2"
|
5
|
+
gem "sinatra", ">=1.2.0"
|
@@ -1,7 +1,7 @@
|
|
1
1
|
GEM
|
2
2
|
remote: http://rubygems.org/
|
3
3
|
specs:
|
4
|
-
aruba (0.3.
|
4
|
+
aruba (0.3.6)
|
5
5
|
childprocess (>= 0.1.7)
|
6
6
|
cucumber (>= 0.10.0)
|
7
7
|
rspec (>= 2.5.0)
|
@@ -16,60 +16,57 @@ GEM
|
|
16
16
|
selenium-webdriver (>= 0.0.27)
|
17
17
|
xpath (~> 0.1.3)
|
18
18
|
celerity (0.8.9)
|
19
|
-
childprocess (0.1.
|
19
|
+
childprocess (0.1.9)
|
20
20
|
ffi (~> 1.0.6)
|
21
|
-
cucumber (0.10.
|
21
|
+
cucumber (0.10.2)
|
22
22
|
builder (>= 2.1.2)
|
23
|
-
diff-lcs (
|
24
|
-
gherkin (
|
25
|
-
json (
|
26
|
-
term-ansicolor (
|
27
|
-
cukesalad (0.6.
|
28
|
-
aruba (
|
29
|
-
cucumber (
|
30
|
-
rspec (
|
23
|
+
diff-lcs (>= 1.1.2)
|
24
|
+
gherkin (>= 2.3.5)
|
25
|
+
json (>= 1.4.6)
|
26
|
+
term-ansicolor (>= 1.0.5)
|
27
|
+
cukesalad (0.6.1)
|
28
|
+
aruba (>= 0.3.5)
|
29
|
+
cucumber (>= 0.10.0)
|
30
|
+
rspec (>= 2.5.0)
|
31
31
|
culerity (0.2.15)
|
32
32
|
diff-lcs (1.1.2)
|
33
|
-
ffi (1.0.
|
34
|
-
|
35
|
-
gherkin (2.3.5)
|
33
|
+
ffi (1.0.8)
|
34
|
+
gherkin (2.3.8)
|
36
35
|
json (>= 1.4.6)
|
37
|
-
json (1.
|
36
|
+
json (1.5.1)
|
38
37
|
json_pure (1.5.1)
|
39
38
|
mime-types (1.16)
|
40
39
|
nokogiri (1.4.4)
|
41
40
|
rack (1.2.2)
|
42
|
-
rack-test (0.
|
41
|
+
rack-test (0.6.0)
|
43
42
|
rack (>= 1.0)
|
44
|
-
|
45
|
-
|
46
|
-
rspec-
|
47
|
-
rspec-
|
48
|
-
|
49
|
-
rspec-
|
50
|
-
rspec-expectations (2.5.0)
|
43
|
+
rspec (2.6.0)
|
44
|
+
rspec-core (~> 2.6.0)
|
45
|
+
rspec-expectations (~> 2.6.0)
|
46
|
+
rspec-mocks (~> 2.6.0)
|
47
|
+
rspec-core (2.6.0)
|
48
|
+
rspec-expectations (2.6.0)
|
51
49
|
diff-lcs (~> 1.1.2)
|
52
|
-
rspec-mocks (2.
|
50
|
+
rspec-mocks (2.6.0)
|
53
51
|
rubyzip (0.9.4)
|
54
|
-
selenium-webdriver (0.
|
52
|
+
selenium-webdriver (0.2.0)
|
55
53
|
childprocess (>= 0.1.7)
|
56
54
|
ffi (>= 1.0.7)
|
57
55
|
json_pure
|
58
56
|
rubyzip
|
59
|
-
sinatra (1.2.
|
57
|
+
sinatra (1.2.6)
|
60
58
|
rack (~> 1.1)
|
61
59
|
tilt (< 2.0, >= 1.2.2)
|
62
60
|
term-ansicolor (1.0.5)
|
63
|
-
tilt (1.
|
64
|
-
xpath (0.1.
|
61
|
+
tilt (1.3)
|
62
|
+
xpath (0.1.4)
|
65
63
|
nokogiri (~> 1.3)
|
66
64
|
|
67
65
|
PLATFORMS
|
68
66
|
ruby
|
69
67
|
|
70
68
|
DEPENDENCIES
|
71
|
-
capybara (
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
sinatra (= 1.2.0)
|
69
|
+
capybara (>= 0.4.1.2)
|
70
|
+
cukesalad (>= 0.6)
|
71
|
+
rspec (>= 2.5.0)
|
72
|
+
sinatra (>= 1.2.0)
|
File without changes
|
data/Examples/Calculator/features/lib/default/tasks/{calculate.rb → arithmetic/calculate.rb}
RENAMED
File without changes
|
File without changes
|
File without changes
|
data/Examples/Calculator/features/lib/default/tasks/{calculations.rb → reference/calculations.rb}
RENAMED
File without changes
|
data/Gemfile
CHANGED
@@ -1,9 +1,4 @@
|
|
1
1
|
source :rubygems
|
2
|
-
gem "cucumber", "0.10.0"
|
3
|
-
gem "rspec", "2.5.0", :require => 'spec'
|
4
|
-
gem "aruba", "0.3.5"
|
5
2
|
|
6
|
-
|
7
|
-
|
8
|
-
gem "jeweler", "~> 1.5.2"
|
9
|
-
end
|
3
|
+
# Specify your gem's dependencies in cukesalad.gemspec
|
4
|
+
gemspec
|
data/Gemfile.lock
CHANGED
@@ -1,47 +1,47 @@
|
|
1
|
+
PATH
|
2
|
+
remote: .
|
3
|
+
specs:
|
4
|
+
cukesalad (0.6.1)
|
5
|
+
aruba (>= 0.3.5)
|
6
|
+
cucumber (>= 0.10.0)
|
7
|
+
rspec (>= 2.5.0)
|
8
|
+
|
1
9
|
GEM
|
2
10
|
remote: http://rubygems.org/
|
3
11
|
specs:
|
4
|
-
aruba (0.3.
|
12
|
+
aruba (0.3.6)
|
5
13
|
childprocess (>= 0.1.7)
|
6
14
|
cucumber (>= 0.10.0)
|
7
15
|
rspec (>= 2.5.0)
|
8
16
|
builder (3.0.0)
|
9
|
-
childprocess (0.1.
|
10
|
-
ffi (~> 0.6
|
11
|
-
cucumber (0.10.
|
17
|
+
childprocess (0.1.9)
|
18
|
+
ffi (~> 1.0.6)
|
19
|
+
cucumber (0.10.2)
|
12
20
|
builder (>= 2.1.2)
|
13
|
-
diff-lcs (
|
14
|
-
gherkin (
|
15
|
-
json (
|
16
|
-
term-ansicolor (
|
21
|
+
diff-lcs (>= 1.1.2)
|
22
|
+
gherkin (>= 2.3.5)
|
23
|
+
json (>= 1.4.6)
|
24
|
+
term-ansicolor (>= 1.0.5)
|
17
25
|
diff-lcs (1.1.2)
|
18
|
-
ffi (0.
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
git (1.2.5)
|
23
|
-
jeweler (1.5.2)
|
24
|
-
bundler (~> 1.0.0)
|
25
|
-
git (>= 1.2.5)
|
26
|
-
rake
|
27
|
-
json (1.4.6)
|
26
|
+
ffi (1.0.8)
|
27
|
+
gherkin (2.3.8)
|
28
|
+
json (>= 1.4.6)
|
29
|
+
json (1.5.1)
|
28
30
|
rake (0.8.7)
|
29
|
-
rspec (2.
|
30
|
-
rspec-core (~> 2.
|
31
|
-
rspec-expectations (~> 2.
|
32
|
-
rspec-mocks (~> 2.
|
33
|
-
rspec-core (2.
|
34
|
-
rspec-expectations (2.
|
31
|
+
rspec (2.6.0)
|
32
|
+
rspec-core (~> 2.6.0)
|
33
|
+
rspec-expectations (~> 2.6.0)
|
34
|
+
rspec-mocks (~> 2.6.0)
|
35
|
+
rspec-core (2.6.0)
|
36
|
+
rspec-expectations (2.6.0)
|
35
37
|
diff-lcs (~> 1.1.2)
|
36
|
-
rspec-mocks (2.
|
38
|
+
rspec-mocks (2.6.0)
|
37
39
|
term-ansicolor (1.0.5)
|
38
40
|
|
39
41
|
PLATFORMS
|
40
42
|
ruby
|
41
43
|
|
42
44
|
DEPENDENCIES
|
43
|
-
aruba (= 0.3.5)
|
44
45
|
bundler (~> 1.0.0)
|
45
|
-
|
46
|
-
|
47
|
-
rspec (= 2.5.0)
|
46
|
+
cukesalad!
|
47
|
+
rake (~> 0.8.7)
|
data/Rakefile
CHANGED
@@ -8,27 +8,7 @@ rescue Bundler::BundlerError => e
|
|
8
8
|
exit e.status_code
|
9
9
|
end
|
10
10
|
require 'rake'
|
11
|
-
|
12
|
-
require 'jeweler'
|
13
|
-
Jeweler::Tasks.new do |gem|
|
14
|
-
# gem is a Gem::Specification... see http://docs.rubygems.org/read/chapter/20 for more options
|
15
|
-
gem.name = "cukesalad"
|
16
|
-
gem.homepage = "https://github.com/RiverGlide/CukeSalad"
|
17
|
-
gem.platform = Gem::Platform::RUBY
|
18
|
-
gem.license = "MIT"
|
19
|
-
gem.summary = %Q{Friction Free BDD/ATDD with cucumber}
|
20
|
-
gem.description = %Q{CukeSalad allows you to focus on the tasks at hand - expressing examples, the roles involved in those examples and the tasks that those roles need to perform with the product under development.}
|
21
|
-
gem.email = "talktous@riverglide.com"
|
22
|
-
gem.authors = ["RiverGlide"]
|
23
|
-
|
24
|
-
# The following two lines need to be commented out in order to gain access to the version rake tasks
|
25
|
-
gem_version = File.exist?('VERSION') ? File.read('VERSION') : ""
|
26
|
-
gem.version = gem_version
|
27
|
-
gem.executables = ["cukesalad"]
|
28
|
-
gem.files.include 'lib/cukesalad/cli.rb'
|
29
|
-
end
|
30
|
-
|
31
|
-
Jeweler::RubygemsDotOrgTasks.new
|
11
|
+
Bundler::GemHelper.install_tasks
|
32
12
|
|
33
13
|
require 'rspec/core'
|
34
14
|
require 'rspec/core/rake_task'
|
data/cukesalad.gemspec
ADDED
@@ -0,0 +1,29 @@
|
|
1
|
+
# -*- encoding: utf-8 -*-
|
2
|
+
$:.push File.expand_path("../lib", __FILE__)
|
3
|
+
require "cukesalad/version"
|
4
|
+
|
5
|
+
Gem::Specification.new do |s|
|
6
|
+
s.name = "cukesalad"
|
7
|
+
s.version = CukeSalad::VERSION
|
8
|
+
s.platform = Gem::Platform::RUBY
|
9
|
+
s.authors = ["RiverGlide"]
|
10
|
+
s.email = ["talktous@riverglide.com"]
|
11
|
+
s.homepage = "https://github.com/RiverGlide/CukeSalad"
|
12
|
+
s.summary = %q{Friction Free BDD/ATDD with cucumber}
|
13
|
+
s.description = %q{CukeSalad allows you to focus on the tasks at hand - expressing examples, the roles involved in those examples and the tasks that those roles need to perform with the product under development.}
|
14
|
+
|
15
|
+
s.licenses = ["MIT"]
|
16
|
+
|
17
|
+
s.files = `git ls-files`.split("\n")
|
18
|
+
s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
|
19
|
+
s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
|
20
|
+
s.default_executable = "cukesalad"
|
21
|
+
s.require_paths = ["lib"]
|
22
|
+
|
23
|
+
s.add_runtime_dependency "cucumber", ">=0.10.0"
|
24
|
+
s.add_runtime_dependency "rspec", ">=2.5.0"
|
25
|
+
s.add_runtime_dependency "aruba", ">=0.3.5"
|
26
|
+
|
27
|
+
s.add_development_dependency "bundler", "~> 1.0.0"
|
28
|
+
s.add_development_dependency "rake", "~> 0.8.7"
|
29
|
+
end
|
@@ -8,23 +8,6 @@ Feature: Define the Task
|
|
8
8
|
Given you are a Step Free Cuker
|
9
9
|
And you were able to create a new Cuke Salad project
|
10
10
|
And you were able to create a role: called 'NewCustomer'
|
11
|
-
|
12
|
-
Scenario: We'll tell you what you need to do to describe the task
|
13
|
-
Given you did not create a task: called 'do something'
|
14
|
-
When you attempt to run a scenario: containing
|
15
|
-
"""
|
16
|
-
Given I am a New Customer
|
17
|
-
And I was able to do something
|
18
|
-
"""
|
19
|
-
Then you should see it has 'failed'
|
20
|
-
And you should see a reply that includes:
|
21
|
-
"""
|
22
|
-
I can't find a task called 'do something'. Have you created it?
|
23
|
-
e.g.
|
24
|
-
in_order_to 'do something' do
|
25
|
-
# the actions
|
26
|
-
end
|
27
|
-
"""
|
28
11
|
|
29
12
|
Scenario Outline: Once you've created the task, you see the step pass
|
30
13
|
Given you did create a task: called 'do something'
|
@@ -53,3 +36,20 @@ Feature: Define the Task
|
|
53
36
|
| And I should do something |
|
54
37
|
| Then you should do something |
|
55
38
|
| And you should do something |
|
39
|
+
|
40
|
+
Scenario: We'll tell you what you need to do to describe the task
|
41
|
+
Given you did not create a task: called 'do something'
|
42
|
+
When you attempt to run a scenario: containing
|
43
|
+
"""
|
44
|
+
Given I am a New Customer
|
45
|
+
And I was able to do something
|
46
|
+
"""
|
47
|
+
Then you should see it has 'failed'
|
48
|
+
And you should see a reply that includes:
|
49
|
+
"""
|
50
|
+
I can't find a task called 'do something'. Have you created it?
|
51
|
+
e.g.
|
52
|
+
in_order_to 'do something' do
|
53
|
+
# the actions
|
54
|
+
end
|
55
|
+
"""
|
@@ -1,12 +1,12 @@
|
|
1
1
|
Feature: Remember information between steps
|
2
2
|
As a Step Free Cuker
|
3
|
-
|
4
|
-
So that
|
3
|
+
You want information captured in one step to be available in a later step
|
4
|
+
So that you can deal with situations where dynamic information is required in later steps
|
5
5
|
|
6
6
|
Background:
|
7
7
|
Given you are a Step Free Cuker
|
8
8
|
And you were able to create a new Cuke Salad project
|
9
|
-
And you were able to create a role
|
9
|
+
And you were able to create a role, called 'NewCustomer'
|
10
10
|
|
11
11
|
Scenario: You can reuse information
|
12
12
|
Given you were able to create a task, called 'do something' containing
|
@@ -21,7 +21,7 @@ Feature: Remember information between steps
|
|
21
21
|
recall :some_key
|
22
22
|
end
|
23
23
|
"""
|
24
|
-
When you attempt to run a scenario
|
24
|
+
When you attempt to run a scenario, containing
|
25
25
|
"""
|
26
26
|
Given I am a New Customer
|
27
27
|
When I attempt to do something, remembering 'a value'
|
@@ -37,7 +37,7 @@ Feature: Remember information between steps
|
|
37
37
|
recall :some_key
|
38
38
|
end
|
39
39
|
"""
|
40
|
-
When I attempt to run a scenario
|
40
|
+
When I attempt to run a scenario, containing
|
41
41
|
"""
|
42
42
|
Given I am a New Customer
|
43
43
|
Then I should find that the thing remembered was 'a value'
|
data/features/support/env.rb
CHANGED
data/lib/cukesalad.rb
CHANGED
@@ -1,36 +1,2 @@
|
|
1
|
-
|
2
|
-
require '
|
3
|
-
require 'bundler'
|
4
|
-
require 'actor'
|
5
|
-
require 'task_author'
|
6
|
-
require 'specifics'
|
7
|
-
Bundler.setup
|
8
|
-
|
9
|
-
World(Specifics)
|
10
|
-
|
11
|
-
When /^I say hello CukeSalad$/ do
|
12
|
-
puts "CukeSalad says: Hello!!"
|
13
|
-
end
|
14
|
-
|
15
|
-
Given /^(?:I am|you are) a ([a-zA-Z ]+)$/ do |role|
|
16
|
-
@actor = Actor.new(role)
|
17
|
-
end
|
18
|
-
|
19
|
-
When /^(?:I|you) (?:attempt to|was able to|were able to|did)? ([A-Z a-z_-]*)(?:[:|,] (.*))?:?$/ do | this_task, details, *and_more |
|
20
|
-
info = understand_the details unless details.nil?
|
21
|
-
info[info.keys.last] = and_more[0] unless and_more.empty?
|
22
|
-
@actor.perform this_task, info unless info.nil?
|
23
|
-
@actor.perform this_task if info.nil?
|
24
|
-
end
|
25
|
-
|
26
|
-
Then /^(?:I|you) should ([^':]*)(?: '([^']*)')$/ do | this_question, expect_value |
|
27
|
-
@actor.answer( this_question ).to_s.should == expect_value
|
28
|
-
end
|
29
|
-
|
30
|
-
Then /^(?:I|you) should ([^':]+)$/ do | this_question |
|
31
|
-
@actor.answer( this_question )
|
32
|
-
end
|
33
|
-
|
34
|
-
Then /^(?:I|you) should ([^']*) that includes:$/ do | this_question, expected_content |
|
35
|
-
@actor.answer( this_question ).should include( expected_content )
|
36
|
-
end
|
1
|
+
require 'cukesalad/salad'
|
2
|
+
require 'cukesalad/cucumber'
|
@@ -0,0 +1,49 @@
|
|
1
|
+
require 'cukesalad/director'
|
2
|
+
|
3
|
+
module CukeSalad
|
4
|
+
class Actor
|
5
|
+
|
6
|
+
def initialize this_type_of_role, directed_by=Director.new
|
7
|
+
@director = directed_by
|
8
|
+
get_into_character_for this_type_of_role
|
9
|
+
@note_pad = {}
|
10
|
+
end
|
11
|
+
|
12
|
+
def perform described_task, details = {}
|
13
|
+
get_ready_to_perform described_task
|
14
|
+
@info = details
|
15
|
+
perform_task
|
16
|
+
end
|
17
|
+
alias :answer :perform
|
18
|
+
|
19
|
+
def get_into_character_for described_role
|
20
|
+
the_role = @director.explain_the_role described_role
|
21
|
+
see_how_to_do the_role
|
22
|
+
end
|
23
|
+
|
24
|
+
def get_ready_to_perform something
|
25
|
+
the_thing = @director.how_do_i_perform something
|
26
|
+
see_how_to_do the_thing
|
27
|
+
end
|
28
|
+
|
29
|
+
def see_how_to_do something
|
30
|
+
extend something
|
31
|
+
end
|
32
|
+
|
33
|
+
def value_of(symbol)
|
34
|
+
@info[symbol]
|
35
|
+
end
|
36
|
+
|
37
|
+
def take_note_of key, value
|
38
|
+
@note_pad.store key, value
|
39
|
+
end
|
40
|
+
|
41
|
+
def recall key
|
42
|
+
begin
|
43
|
+
@note_pad.fetch key
|
44
|
+
rescue KeyError
|
45
|
+
raise KeyError, "You tried to recall ':#{key}' but no previous step appears to have taken note of that information."
|
46
|
+
end
|
47
|
+
end
|
48
|
+
end
|
49
|
+
end
|