cuke_modeler 0.0.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.
- checksums.yaml +7 -0
- data/.gitignore +17 -0
- data/.simplecov +8 -0
- data/Gemfile +4 -0
- data/History.rdoc +3 -0
- data/LICENSE.txt +22 -0
- data/README.md +73 -0
- data/Rakefile +38 -0
- data/cuke_modeler.gemspec +29 -0
- data/features/analysis/test_comparison.feature +123 -0
- data/features/analysis/test_manipulation.feature +37 -0
- data/features/modeling/background_modeling.feature +75 -0
- data/features/modeling/background_output.feature +130 -0
- data/features/modeling/directory_modeling.feature +120 -0
- data/features/modeling/directory_output.feature +13 -0
- data/features/modeling/doc_string_modeling.feature +63 -0
- data/features/modeling/doc_string_output.feature +71 -0
- data/features/modeling/example_modeling.feature +111 -0
- data/features/modeling/example_output.feature +192 -0
- data/features/modeling/feature_file_modeling.feature +64 -0
- data/features/modeling/feature_file_output.feature +13 -0
- data/features/modeling/feature_modeling.feature +164 -0
- data/features/modeling/feature_output.feature +244 -0
- data/features/modeling/outline_modeling.feature +100 -0
- data/features/modeling/outline_output.feature +197 -0
- data/features/modeling/row_modeling.feature +77 -0
- data/features/modeling/row_output.feature +27 -0
- data/features/modeling/scenario_modeling.feature +89 -0
- data/features/modeling/scenario_output.feature +147 -0
- data/features/modeling/step_modeling.feature +85 -0
- data/features/modeling/step_output.feature +52 -0
- data/features/modeling/table_modeling.feature +52 -0
- data/features/modeling/table_output.feature +42 -0
- data/features/modeling/table_row_modeling.feature +67 -0
- data/features/modeling/table_row_output.feature +27 -0
- data/features/modeling/tag_modeling.feature +58 -0
- data/features/modeling/tag_output.feature +16 -0
- data/features/step_definitions/action_steps.rb +3 -0
- data/features/step_definitions/background_steps.rb +81 -0
- data/features/step_definitions/directory_steps.rb +52 -0
- data/features/step_definitions/doc_string_steps.rb +63 -0
- data/features/step_definitions/feature_file_steps.rb +41 -0
- data/features/step_definitions/feature_steps.rb +96 -0
- data/features/step_definitions/outline_steps.rb +252 -0
- data/features/step_definitions/setup_steps.rb +50 -0
- data/features/step_definitions/spec_steps.rb +18 -0
- data/features/step_definitions/step_steps.rb +159 -0
- data/features/step_definitions/table_steps.rb +54 -0
- data/features/step_definitions/tag_steps.rb +61 -0
- data/features/step_definitions/test_steps.rb +114 -0
- data/features/step_definitions/verification_steps.rb +9 -0
- data/features/support/env.rb +27 -0
- data/features/support/transforms.rb +3 -0
- data/lib/cuke_modeler.rb +29 -0
- data/lib/cuke_modeler/background.rb +38 -0
- data/lib/cuke_modeler/containing.rb +18 -0
- data/lib/cuke_modeler/directory.rb +86 -0
- data/lib/cuke_modeler/doc_string.rb +87 -0
- data/lib/cuke_modeler/example.rb +184 -0
- data/lib/cuke_modeler/feature.rb +147 -0
- data/lib/cuke_modeler/feature_element.rb +73 -0
- data/lib/cuke_modeler/feature_file.rb +77 -0
- data/lib/cuke_modeler/nested.rb +34 -0
- data/lib/cuke_modeler/outline.rb +68 -0
- data/lib/cuke_modeler/parsing.rb +32 -0
- data/lib/cuke_modeler/raw.rb +20 -0
- data/lib/cuke_modeler/row.rb +64 -0
- data/lib/cuke_modeler/scenario.rb +45 -0
- data/lib/cuke_modeler/sourceable.rb +20 -0
- data/lib/cuke_modeler/step.rb +214 -0
- data/lib/cuke_modeler/table.rb +90 -0
- data/lib/cuke_modeler/table_row.rb +64 -0
- data/lib/cuke_modeler/tag.rb +62 -0
- data/lib/cuke_modeler/taggable.rb +54 -0
- data/lib/cuke_modeler/test_element.rb +77 -0
- data/lib/cuke_modeler/version.rb +3 -0
- data/lib/cuke_modeler/world.rb +113 -0
- data/spec/integration/background_integration_spec.rb +72 -0
- data/spec/integration/directory_integration_spec.rb +48 -0
- data/spec/integration/doc_string_integration_spec.rb +66 -0
- data/spec/integration/example_integration_spec.rb +94 -0
- data/spec/integration/feature_file_integration_spec.rb +44 -0
- data/spec/integration/feature_integration_spec.rb +152 -0
- data/spec/integration/outline_integration_spec.rb +92 -0
- data/spec/integration/scenario_integration_spec.rb +80 -0
- data/spec/integration/step_integration_spec.rb +184 -0
- data/spec/integration/table_integration_spec.rb +86 -0
- data/spec/integration/table_row_integration_spec.rb +68 -0
- data/spec/integration/tag_integration_spec.rb +67 -0
- data/spec/integration/world_integration_spec.rb +13 -0
- data/spec/spec_helper.rb +30 -0
- data/spec/unit/background_unit_spec.rb +55 -0
- data/spec/unit/bare_bones_unit_specs.rb +13 -0
- data/spec/unit/containing_element_unit_specs.rb +17 -0
- data/spec/unit/directory_unit_spec.rb +103 -0
- data/spec/unit/doc_string_unit_spec.rb +109 -0
- data/spec/unit/example_unit_spec.rb +251 -0
- data/spec/unit/feature_element_unit_spec.rb +19 -0
- data/spec/unit/feature_element_unit_specs.rb +46 -0
- data/spec/unit/feature_file_unit_spec.rb +94 -0
- data/spec/unit/feature_unit_spec.rb +135 -0
- data/spec/unit/nested_element_unit_specs.rb +36 -0
- data/spec/unit/nested_unit_spec.rb +37 -0
- data/spec/unit/outline_unit_spec.rb +91 -0
- data/spec/unit/parsing_unit_spec.rb +21 -0
- data/spec/unit/prepopulated_unit_specs.rb +13 -0
- data/spec/unit/raw_element_unit_specs.rb +24 -0
- data/spec/unit/raw_unit_spec.rb +25 -0
- data/spec/unit/row_unit_spec.rb +55 -0
- data/spec/unit/scenario_unit_spec.rb +71 -0
- data/spec/unit/sourceable_unit_spec.rb +17 -0
- data/spec/unit/sourced_element_unit_specs.rb +18 -0
- data/spec/unit/step_unit_spec.rb +259 -0
- data/spec/unit/table_row_unit_spec.rb +55 -0
- data/spec/unit/table_unit_spec.rb +96 -0
- data/spec/unit/tag_unit_spec.rb +51 -0
- data/spec/unit/taggable_unit_spec.rb +78 -0
- data/spec/unit/tagged_element_unit_specs.rb +63 -0
- data/spec/unit/test_element_unit_spec.rb +40 -0
- data/spec/unit/test_element_unit_specs.rb +31 -0
- data/spec/unit/world_unit_spec.rb +130 -0
- metadata +364 -0
checksums.yaml
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
---
|
|
2
|
+
SHA1:
|
|
3
|
+
metadata.gz: 876bbe0bbe75f460596777b28b51a51bd3347c01
|
|
4
|
+
data.tar.gz: 5ee73b6f5366259721f57dbca7ca7120b9497243
|
|
5
|
+
SHA512:
|
|
6
|
+
metadata.gz: f8b1099a66acacf4442cc6d5a64f61ae52762727fe8f70279a6049b450de56b49335b502ec7ecbc84395404ac0081df7792a6de6a2b6f6e7c1bbcb361e590a36
|
|
7
|
+
data.tar.gz: 387d74e18f8be3cd4b028f8f2d1e79660ee67041636f701af58601bf660b9731e97ed5482e4c91add71f8f33856b05274e785dacd79c5a19d6e4a4f9749b2bf6
|
data/.gitignore
ADDED
data/.simplecov
ADDED
data/Gemfile
ADDED
data/History.rdoc
ADDED
data/LICENSE.txt
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
Copyright (c) 2014 Eric Kessler
|
|
2
|
+
|
|
3
|
+
MIT License
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
|
6
|
+
a copy of this software and associated documentation files (the
|
|
7
|
+
"Software"), to deal in the Software without restriction, including
|
|
8
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
|
9
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
|
10
|
+
permit persons to whom the Software is furnished to do so, subject to
|
|
11
|
+
the following conditions:
|
|
12
|
+
|
|
13
|
+
The above copyright notice and this permission notice shall be
|
|
14
|
+
included in all copies or substantial portions of the Software.
|
|
15
|
+
|
|
16
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
|
17
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
|
18
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
|
19
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
|
20
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
|
21
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
|
22
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/README.md
ADDED
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
# CukeModeler
|
|
2
|
+
|
|
3
|
+
The intention of this gem is to provide the ability to model a Cucumber test
|
|
4
|
+
suite. It provides a foundation upon which to build other useful tools for
|
|
5
|
+
interacting with a test suite that is written in Gherkin (and written with
|
|
6
|
+
Cucumber in particular).
|
|
7
|
+
|
|
8
|
+
## Installation
|
|
9
|
+
|
|
10
|
+
Add this line to your application's Gemfile:
|
|
11
|
+
|
|
12
|
+
gem 'cuke_modeler'
|
|
13
|
+
|
|
14
|
+
And then execute:
|
|
15
|
+
|
|
16
|
+
$ bundle
|
|
17
|
+
|
|
18
|
+
Or install it yourself as:
|
|
19
|
+
|
|
20
|
+
$ gem install cuke_modeler
|
|
21
|
+
|
|
22
|
+
## Usage
|
|
23
|
+
|
|
24
|
+
First, load up the gem code.
|
|
25
|
+
|
|
26
|
+
require 'cuke_modeler'
|
|
27
|
+
|
|
28
|
+
Next, choose what you want to model. Directories and feature files are the most
|
|
29
|
+
common thing to model but smaller portions of a test suite can be modeled as well.
|
|
30
|
+
|
|
31
|
+
directory = CukeModeler::Directory.new('path/to/the/code_directory')
|
|
32
|
+
file = CukeModeler::FeatureFile.new('path/to/the/feature_file')
|
|
33
|
+
|
|
34
|
+
gherkin = "Scenario: some test\n* a step"
|
|
35
|
+
test = CukeModeler::Scenario.new(gherkin)
|
|
36
|
+
|
|
37
|
+
The models can then be inspected for information.
|
|
38
|
+
|
|
39
|
+
directory.path #=> 'path/to/the/code_directory'
|
|
40
|
+
file.feature.name #=> 'the name of the feature'
|
|
41
|
+
test.steps.count #=> 1
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+
Things can be done in the other direction as well by starting with empty models
|
|
45
|
+
and setting their attributes afterward.
|
|
46
|
+
|
|
47
|
+
step = CukeModeler::Step.new
|
|
48
|
+
step.keyword = 'Given'
|
|
49
|
+
step.base = 'some step'
|
|
50
|
+
|
|
51
|
+
test = CukeModeler::Scenario.new
|
|
52
|
+
test.steps = [step]
|
|
53
|
+
|
|
54
|
+
test.to_s #=> "Scenario:\n Given some step"
|
|
55
|
+
|
|
56
|
+
One could, if so inclined, use this method to dynamically edit or even create an
|
|
57
|
+
entire test suite.
|
|
58
|
+
|
|
59
|
+
|
|
60
|
+
### Other gems that are (or soon will be) powered by cuke_modeler
|
|
61
|
+
|
|
62
|
+
https://github.com/enkessler/cucumber_analytics
|
|
63
|
+
https://github.com/enkessler/cql
|
|
64
|
+
https://github.com/enkessler/cuketagger
|
|
65
|
+
https://github.com/enkessler/cuke_cataloger
|
|
66
|
+
|
|
67
|
+
## Contributing
|
|
68
|
+
|
|
69
|
+
1. Fork it
|
|
70
|
+
2. Create your feature branch (`git checkout -b my-new-feature`)
|
|
71
|
+
3. Commit your changes (`git commit -am 'Add some feature'`)
|
|
72
|
+
4. Push to the branch (`git push origin my-new-feature`)
|
|
73
|
+
5. Create new Pull Request
|
data/Rakefile
ADDED
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
require "bundler/gem_tasks"
|
|
2
|
+
require 'cucumber/rake/task'
|
|
3
|
+
require 'rspec/core/rake_task'
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
def set_cucumber_options(options)
|
|
7
|
+
ENV['CUCUMBER_OPTS'] = options
|
|
8
|
+
end
|
|
9
|
+
|
|
10
|
+
def combine_options(set_1, set_2)
|
|
11
|
+
set_2 ? "#{set_1} #{set_2}" : set_1
|
|
12
|
+
end
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
task :clear_coverage do
|
|
16
|
+
code_coverage_directory = "#{File.dirname(__FILE__)}/coverage"
|
|
17
|
+
|
|
18
|
+
FileUtils.remove_dir(code_coverage_directory, true)
|
|
19
|
+
end
|
|
20
|
+
|
|
21
|
+
desc 'Run all Cucumber tests for the gem'
|
|
22
|
+
task :tests, [:options] do |t, args|
|
|
23
|
+
set_cucumber_options(combine_options("-t ~@wip -t ~@off -f progress", args[:options]))
|
|
24
|
+
end
|
|
25
|
+
Cucumber::Rake::Task.new(:tests)
|
|
26
|
+
|
|
27
|
+
desc 'Run all RSpec tests for the gem'
|
|
28
|
+
RSpec::Core::RakeTask.new(:specs) do |t|
|
|
29
|
+
t.rspec_opts = "-t ~wip -t ~off"
|
|
30
|
+
end
|
|
31
|
+
|
|
32
|
+
desc 'Run All The Things'
|
|
33
|
+
task :everything => :clear_coverage do
|
|
34
|
+
Rake::Task[:specs].invoke
|
|
35
|
+
Rake::Task[:tests].invoke('-t ~@redundant')
|
|
36
|
+
end
|
|
37
|
+
|
|
38
|
+
task :default => :everything
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
# coding: utf-8
|
|
2
|
+
lib = File.expand_path('../lib', __FILE__)
|
|
3
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
|
4
|
+
require 'cuke_modeler/version'
|
|
5
|
+
|
|
6
|
+
Gem::Specification.new do |spec|
|
|
7
|
+
spec.name = "cuke_modeler"
|
|
8
|
+
spec.version = CukeModeler::VERSION
|
|
9
|
+
spec.authors = ["Eric Kessler"]
|
|
10
|
+
spec.email = ["morrow748@gmail.com"]
|
|
11
|
+
spec.summary = %q{A gem providing functionality to model a Cucumber test suite.}
|
|
12
|
+
spec.homepage = 'https://github.com/enkessler/cuke_modeler'
|
|
13
|
+
spec.license = "MIT"
|
|
14
|
+
|
|
15
|
+
spec.files = `git ls-files -z`.split("\x0")
|
|
16
|
+
spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
|
|
17
|
+
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
|
18
|
+
spec.require_paths = ["lib"]
|
|
19
|
+
|
|
20
|
+
spec.add_runtime_dependency('gherkin')
|
|
21
|
+
spec.add_runtime_dependency('json', '~> 1.0')
|
|
22
|
+
spec.add_runtime_dependency('multi_json', '~> 1.0')
|
|
23
|
+
|
|
24
|
+
spec.add_development_dependency "bundler", "~> 1.5"
|
|
25
|
+
spec.add_development_dependency "rake"
|
|
26
|
+
spec.add_development_dependency 'cucumber'
|
|
27
|
+
spec.add_development_dependency 'rspec', '~> 2.14.0'
|
|
28
|
+
spec.add_development_dependency 'simplecov'
|
|
29
|
+
end
|
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
Feature: Test equality can be determined.
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
Acceptance criteria
|
|
5
|
+
|
|
6
|
+
Tests can be compared for equality.
|
|
7
|
+
1. tests whose steps are the same except for arguments and keywords (i.e.
|
|
8
|
+
they match the same step definition) are equal
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
Background: Test file setup.
|
|
12
|
+
Given the following feature file:
|
|
13
|
+
"""
|
|
14
|
+
Feature: A feature with duplicate tests.
|
|
15
|
+
|
|
16
|
+
Scenario: A test
|
|
17
|
+
Given this *parameterized* step takes a table:
|
|
18
|
+
| data 1 |
|
|
19
|
+
| data 2 |
|
|
20
|
+
And some setup step
|
|
21
|
+
When a step with a *parameter*
|
|
22
|
+
And a big step:
|
|
23
|
+
\"\"\"
|
|
24
|
+
little doc block
|
|
25
|
+
\"\"\"
|
|
26
|
+
Then *lots* *of* *parameters*
|
|
27
|
+
|
|
28
|
+
Scenario: Same test, different arguments and keywords
|
|
29
|
+
Given this *similarly parameterized* step takes a table:
|
|
30
|
+
| data 3 |
|
|
31
|
+
| data 4 |
|
|
32
|
+
Given some setup step
|
|
33
|
+
When a step with a *parameter*
|
|
34
|
+
* a big step:
|
|
35
|
+
\"\"\"
|
|
36
|
+
A little
|
|
37
|
+
bigger doc block
|
|
38
|
+
\"\"\"
|
|
39
|
+
Then *lots* *of* *parameters*
|
|
40
|
+
|
|
41
|
+
Scenario Outline: This is the same test as an outline
|
|
42
|
+
Given this *parameterized* step takes a table:
|
|
43
|
+
| <param1> |
|
|
44
|
+
| <param2> |
|
|
45
|
+
And some setup step
|
|
46
|
+
When a step with a *parameter*
|
|
47
|
+
And a big step:
|
|
48
|
+
\"\"\"
|
|
49
|
+
little doc block
|
|
50
|
+
\"\"\"
|
|
51
|
+
Then *lots* *of* *parameters*
|
|
52
|
+
Examples:
|
|
53
|
+
| param1 | param2 |
|
|
54
|
+
| x | y |
|
|
55
|
+
Examples:
|
|
56
|
+
| param1 | param2 |
|
|
57
|
+
| a | b |
|
|
58
|
+
|
|
59
|
+
Scenario Outline: Same outline, different arguments and keywords
|
|
60
|
+
Given this *similarly parameterized* step takes a table:
|
|
61
|
+
| <param3> |
|
|
62
|
+
| <param4> |
|
|
63
|
+
Given some setup step
|
|
64
|
+
When a step with a *slightly different parameter*
|
|
65
|
+
* a big step:
|
|
66
|
+
\"\"\"
|
|
67
|
+
A little
|
|
68
|
+
bigger doc block
|
|
69
|
+
\"\"\"
|
|
70
|
+
Then *lots* *of effectively the same* *parameters*
|
|
71
|
+
Examples:
|
|
72
|
+
| param1 | param2 |
|
|
73
|
+
| h | k |
|
|
74
|
+
Examples:
|
|
75
|
+
| param1 | param2 |
|
|
76
|
+
| i | j |
|
|
77
|
+
|
|
78
|
+
Scenario: A different test
|
|
79
|
+
Given this *parameterized* step takes a table:
|
|
80
|
+
| data 1 |
|
|
81
|
+
| data 2 |
|
|
82
|
+
And not the same setup step as before
|
|
83
|
+
When a step with a *parameter*
|
|
84
|
+
And a big step:
|
|
85
|
+
\"\"\"
|
|
86
|
+
little doc block
|
|
87
|
+
\"\"\"
|
|
88
|
+
Then *lots* *of* *parameters*
|
|
89
|
+
|
|
90
|
+
Scenario Outline: This is the same different test as an outline
|
|
91
|
+
Given this *similarly parameterized* step takes a table:
|
|
92
|
+
| <param1> |
|
|
93
|
+
| <param2> |
|
|
94
|
+
And not the same setup step as before
|
|
95
|
+
When a step with a *slightly different parameter*
|
|
96
|
+
And a big step:
|
|
97
|
+
\"\"\"
|
|
98
|
+
A little
|
|
99
|
+
bigger doc block
|
|
100
|
+
\"\"\"
|
|
101
|
+
Then *lots* *of effectively the same* *parameters*
|
|
102
|
+
Examples:
|
|
103
|
+
| param1 | param2 |
|
|
104
|
+
| x | y |
|
|
105
|
+
Examples:
|
|
106
|
+
| param1 | param2 |
|
|
107
|
+
| a | b |
|
|
108
|
+
"""
|
|
109
|
+
And parameter delimiters of "*" and "*"
|
|
110
|
+
When the file is read
|
|
111
|
+
|
|
112
|
+
|
|
113
|
+
Scenario: Scenario to Scenario comparison
|
|
114
|
+
Then test "1" is equal to test "2"
|
|
115
|
+
And test "1" is not equal to test "5"
|
|
116
|
+
|
|
117
|
+
Scenario: Outline to Outline comparison
|
|
118
|
+
Then test "3" is equal to test "4"
|
|
119
|
+
And test "3" is not equal to test "6"
|
|
120
|
+
|
|
121
|
+
Scenario: Scenario to Outline comparison
|
|
122
|
+
Then test "1" is equal to test "3"
|
|
123
|
+
And test "1" is not equal to test "6"
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
Feature: Tests can be manipulated in various ways.
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
Acceptance criteria
|
|
5
|
+
|
|
6
|
+
Tests can be manipulated:
|
|
7
|
+
1. outlines can have rows added and removed
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
Background: Test file setup.
|
|
11
|
+
Given the following feature file:
|
|
12
|
+
"""
|
|
13
|
+
Feature: A feature containing our starting outline.
|
|
14
|
+
|
|
15
|
+
Scenario Outline:
|
|
16
|
+
Given this *parameterized* step takes a table:
|
|
17
|
+
| <param1> |
|
|
18
|
+
| <param2> |
|
|
19
|
+
Then I don't really need another step
|
|
20
|
+
Examples: Only one row to start with
|
|
21
|
+
| param1 | param2 |
|
|
22
|
+
| x | y |
|
|
23
|
+
"""
|
|
24
|
+
And parameter delimiters of "*" and "*"
|
|
25
|
+
And the file is read
|
|
26
|
+
|
|
27
|
+
Scenario: Rows can be added to an outline
|
|
28
|
+
When the test example block has the following rows added to it:
|
|
29
|
+
| 1,2 |
|
|
30
|
+
Then the test example block rows are as follows:
|
|
31
|
+
| x,y |
|
|
32
|
+
| 1,2 |
|
|
33
|
+
|
|
34
|
+
Scenario: Rows can be removed from an outline
|
|
35
|
+
When the test example block has the following rows removed from it:
|
|
36
|
+
| x,y |
|
|
37
|
+
Then the test example block has no rows
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
Feature: Background elements can be modeled.
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
Acceptance criteria
|
|
5
|
+
|
|
6
|
+
1. All conceptual pieces of a background can be modeled:
|
|
7
|
+
- the background's name
|
|
8
|
+
- the background's description
|
|
9
|
+
- the background's steps
|
|
10
|
+
- the background's source line
|
|
11
|
+
- the background's raw element
|
|
12
|
+
|
|
13
|
+
2. Backgrounds can be outputted in a convenient form
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
Background: Test file setup.
|
|
17
|
+
Given the following feature file:
|
|
18
|
+
"""
|
|
19
|
+
Feature:
|
|
20
|
+
|
|
21
|
+
Background: Some general test setup stuff.
|
|
22
|
+
|
|
23
|
+
Some background description.
|
|
24
|
+
|
|
25
|
+
Some more.
|
|
26
|
+
Even more.
|
|
27
|
+
|
|
28
|
+
Given a setup step
|
|
29
|
+
And another setup step
|
|
30
|
+
When an action step
|
|
31
|
+
"""
|
|
32
|
+
And parameter delimiters of "*" and "*"
|
|
33
|
+
When the file is read
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
Scenario: The raw background element is modeled.
|
|
37
|
+
Then the background correctly stores its underlying implementation
|
|
38
|
+
|
|
39
|
+
Scenario: The background source line is modeled.
|
|
40
|
+
Then the background is found to have the following properties:
|
|
41
|
+
| source_line | 3 |
|
|
42
|
+
|
|
43
|
+
Scenario: The background name is modeled.
|
|
44
|
+
Then the background is found to have the following properties:
|
|
45
|
+
| name | Some general test setup stuff. |
|
|
46
|
+
|
|
47
|
+
Scenario: The background description is modeled.
|
|
48
|
+
Then the background has the following description:
|
|
49
|
+
"""
|
|
50
|
+
|
|
51
|
+
Some background description.
|
|
52
|
+
|
|
53
|
+
Some more.
|
|
54
|
+
Even more.
|
|
55
|
+
"""
|
|
56
|
+
|
|
57
|
+
Scenario: The background steps are modeled.
|
|
58
|
+
Then the background's steps are as follows:
|
|
59
|
+
| a setup step |
|
|
60
|
+
| another setup step |
|
|
61
|
+
| an action step |
|
|
62
|
+
|
|
63
|
+
Scenario: Convenient output of a background
|
|
64
|
+
Then the background has convenient output
|
|
65
|
+
|
|
66
|
+
@redundant
|
|
67
|
+
Scenario Outline: Background models pass all other specifications
|
|
68
|
+
Exact specifications detailing the API for background models.
|
|
69
|
+
Given that there are "<additional specifications>" detailing models
|
|
70
|
+
When the corresponding specifications are run
|
|
71
|
+
Then all of those specifications are met
|
|
72
|
+
Examples:
|
|
73
|
+
| additional specifications |
|
|
74
|
+
| background_unit_spec.rb |
|
|
75
|
+
| background_integration_spec.rb |
|