cuke_slicer 1.0.0 → 2.2.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.
- checksums.yaml +7 -0
- data/.gitignore +2 -0
- data/.travis.yml +33 -0
- data/CHANGELOG.md +67 -0
- data/LICENSE.txt +2 -1
- data/README.md +18 -1
- data/Rakefile +85 -49
- data/appveyor.yml +81 -0
- data/cuke_slicer.gemspec +13 -7
- data/features/step_definitions/action_steps.rb +12 -11
- data/features/step_definitions/setup_steps.rb +24 -0
- data/features/step_definitions/verification_steps.rb +11 -0
- data/features/test_case_extraction.feature +7 -1
- data/features/validation.feature +6 -0
- data/gemfiles/cuke_modeler0.gemfile +28 -0
- data/gemfiles/cuke_modeler1.gemfile +29 -0
- data/gemfiles/cuke_modeler2.gemfile +29 -0
- data/gemfiles/cuke_modeler3.gemfile +12 -0
- data/lib/cuke_slicer.rb +10 -10
- data/lib/cuke_slicer/collections/nested_tag_collection.rb +29 -0
- data/lib/cuke_slicer/collections/path_collection.rb +28 -0
- data/lib/cuke_slicer/collections/tag_collection.rb +30 -0
- data/lib/cuke_slicer/extractors/directory_extractor.rb +19 -0
- data/lib/cuke_slicer/extractors/file_extractor.rb +34 -0
- data/lib/cuke_slicer/filters/filter_set.rb +44 -0
- data/lib/cuke_slicer/helpers/extraction_helpers.rb +44 -0
- data/lib/cuke_slicer/helpers/filter_helpers.rb +62 -0
- data/lib/cuke_slicer/helpers/helpers.rb +23 -0
- data/lib/cuke_slicer/helpers/matching_helpers.rb +52 -0
- data/lib/cuke_slicer/slicer.rb +25 -196
- data/lib/cuke_slicer/version.rb +1 -1
- data/spec/cuke_slicer_spec.rb +15 -0
- data/spec/slicer_integration_spec.rb +151 -43
- data/spec/slicer_unit_spec.rb +3 -3
- metadata +98 -54
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: c69098207d6d5580577ecad5469270b5cbec21138e66739d74815ed0a4442ab3
|
4
|
+
data.tar.gz: 5dd474604bdddeddf0f02ffebec61b6af2a9319f48bc8b8e10f37a94cb7459d0
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 213337d4665b2c5b329c9335fde6afc0af9dbe4031a626eb45eba6acce31924f1df00cbb83a55cfd756dabea379b06c515a4633ff5ee3657170f8e4520acce5d
|
7
|
+
data.tar.gz: cd6e817e1a30de5700bb11f47435a08af612cc7fb218bf07e1f8522d21a3f00eb1578423cb56fbeff136fd38cc36cec310774cbf2a8a223a27ebef202026fe4a
|
data/.travis.yml
ADDED
@@ -0,0 +1,33 @@
|
|
1
|
+
os:
|
2
|
+
- linux
|
3
|
+
- osx
|
4
|
+
|
5
|
+
language: ruby
|
6
|
+
rvm:
|
7
|
+
- 1.9.3
|
8
|
+
- 2.3.8
|
9
|
+
- 2.4.5
|
10
|
+
- 2.5.3
|
11
|
+
- 2.6.0
|
12
|
+
- jruby-9.1.7.0
|
13
|
+
|
14
|
+
gemfile:
|
15
|
+
- gemfiles/cuke_modeler0.gemfile
|
16
|
+
- gemfiles/cuke_modeler1.gemfile
|
17
|
+
- gemfiles/cuke_modeler2.gemfile
|
18
|
+
- gemfiles/cuke_modeler3.gemfile
|
19
|
+
|
20
|
+
matrix:
|
21
|
+
exclude:
|
22
|
+
# Travis does not provide 1.9.3 on OSX
|
23
|
+
- rvm: 1.9.3
|
24
|
+
os: osx
|
25
|
+
# Ruby 2.3.x for OSX is currently broken on TravisCI and is no longer a supported Ruby version, anyway.
|
26
|
+
- rvm: 2.3.8
|
27
|
+
os: osx
|
28
|
+
# cuke_modeler 3.x has a minimum Ruby version of 2.3
|
29
|
+
- rvm: 1.9.3
|
30
|
+
gemfile: gemfiles/cuke_modeler3.gemfile
|
31
|
+
|
32
|
+
|
33
|
+
script: bundle exec rake cuke_slicer:ci_build
|
data/CHANGELOG.md
ADDED
@@ -0,0 +1,67 @@
|
|
1
|
+
# Changelog
|
2
|
+
All notable changes to this project will be documented in this file.
|
3
|
+
|
4
|
+
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
5
|
+
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
6
|
+
|
7
|
+
## [Unreleased]
|
8
|
+
|
9
|
+
Nothing yet...
|
10
|
+
|
11
|
+
## [2.2.0] - 2021-01-07
|
12
|
+
|
13
|
+
### Added
|
14
|
+
- Ruby 3.x is now supported
|
15
|
+
|
16
|
+
## [2.1.0] - 2020-06-22
|
17
|
+
|
18
|
+
### Added
|
19
|
+
- Added support for `cuke_modeler` 2.x and 3.x
|
20
|
+
|
21
|
+
## [2.0.3] - 2019-05-01
|
22
|
+
|
23
|
+
### Added
|
24
|
+
|
25
|
+
- Add dependency version limits to Ruby, which was previously unbound. Previously unofficially supported Ruby versions (1.9.3 - 2.x) are now officially supported.
|
26
|
+
|
27
|
+
|
28
|
+
## [2.0.2] - 2016-11-19
|
29
|
+
|
30
|
+
### Added
|
31
|
+
|
32
|
+
- The gem now declares version limits for all of its dependencies.
|
33
|
+
|
34
|
+
|
35
|
+
## [2.0.1] - 2016-11-08 (yanked)
|
36
|
+
|
37
|
+
### Added
|
38
|
+
|
39
|
+
- Works with both 0.x and 1.x versions of the 'cuke_modeler' gem.
|
40
|
+
|
41
|
+
|
42
|
+
## [2.0.0] - 2015-07-08
|
43
|
+
|
44
|
+
### Added
|
45
|
+
|
46
|
+
- When slicing a directory, the test cases returned can now be provided as model objects in addition to the
|
47
|
+
previous 'file_path:line_number' format.
|
48
|
+
|
49
|
+
### Changed
|
50
|
+
|
51
|
+
- Major performance increase
|
52
|
+
|
53
|
+
|
54
|
+
## [1.0.0] - 2015-04-01
|
55
|
+
|
56
|
+
### Added
|
57
|
+
|
58
|
+
- Initial release
|
59
|
+
|
60
|
+
[Unreleased]: https://github.com/enkessler/cuke_slicer/compare/v2.2.0...HEAD
|
61
|
+
[2.2.0]: https://github.com/enkessler/cuke_slicer/compare/v2.1.0...v2.2.0
|
62
|
+
[2.1.0]: https://github.com/enkessler/cuke_slicer/compare/v2.0.3...v2.1.0
|
63
|
+
[2.0.3]: https://github.com/enkessler/cuke_slicer/compare/v2.0.2...v2.0.3
|
64
|
+
[2.0.2]: https://github.com/enkessler/cuke_slicer/compare/v2.0.1...v2.0.2
|
65
|
+
[2.0.1]: https://github.com/enkessler/cuke_slicer/compare/v2.0.0...v2.0.1
|
66
|
+
[2.0.0]: https://github.com/enkessler/cuke_slicer/compare/v1.0.0...v2.0.0
|
67
|
+
[1.0.0]: https://github.com/enkessler/cuke_slicer/compare/1c6e64b963d97f9037f1dc1ebcb6f8f9966f3b71...v1.0.0
|
data/LICENSE.txt
CHANGED
data/README.md
CHANGED
@@ -1,3 +1,20 @@
|
|
1
|
+
Basic stuff:
|
2
|
+
[](https://rubygems.org/gems/cuke_slicer)
|
3
|
+
[](https://opensource.org/licenses/mit-license.php)
|
4
|
+
[](https://rubygems.org/gems/cuke_slicer)
|
5
|
+
|
6
|
+
User stuff:
|
7
|
+
[](https://www.rubydoc.info/gems/cuke_slicer)
|
8
|
+
|
9
|
+
Developer stuff:
|
10
|
+
[](https://travis-ci.org/enkessler/cuke_slicer)
|
11
|
+
[](https://ci.appveyor.com/project/enkessler/cuke-slicer)
|
12
|
+
[](https://coveralls.io/github/enkessler/cuke_slicer)
|
13
|
+
[](https://codeclimate.com/github/enkessler/cuke_slicer/maintainability)
|
14
|
+
|
15
|
+
---
|
16
|
+
|
17
|
+
|
1
18
|
# CukeSlicer
|
2
19
|
|
3
20
|
The cuke_slicer gem provides an easy and programmatic way to divide a Cucumber test suite into granular test
|
@@ -33,7 +50,7 @@ Or install it yourself as:
|
|
33
50
|
included_paths: [/test_directory/]}
|
34
51
|
|
35
52
|
# Use the slicer to find all tests matching those filters
|
36
|
-
found_tests = CukeSlicer::Slicer.new.slice(test_directory, filters)
|
53
|
+
found_tests = CukeSlicer::Slicer.new.slice(test_directory, filters, :file_line)
|
37
54
|
|
38
55
|
|
39
56
|
# Arrange the sliced pieces to suit your particular needs. In this case, we will dump them
|
data/Rakefile
CHANGED
@@ -1,49 +1,85 @@
|
|
1
|
-
require
|
2
|
-
require '
|
3
|
-
require '
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
end
|
13
|
-
|
14
|
-
|
15
|
-
namespace 'cuke_slicer' do
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
end
|
47
|
-
|
48
|
-
|
49
|
-
task :
|
1
|
+
require 'bundler/gem_tasks'
|
2
|
+
require 'rake'
|
3
|
+
require 'racatt'
|
4
|
+
require 'coveralls/rake/task'
|
5
|
+
require 'rainbow'
|
6
|
+
|
7
|
+
|
8
|
+
Rainbow.enabled = true
|
9
|
+
|
10
|
+
namespace 'racatt' do
|
11
|
+
Racatt.create_tasks
|
12
|
+
end
|
13
|
+
|
14
|
+
|
15
|
+
namespace 'cuke_slicer' do
|
16
|
+
|
17
|
+
desc 'Removes the current code coverage data'
|
18
|
+
task :clear_coverage do
|
19
|
+
code_coverage_directory = "#{File.dirname(__FILE__)}/coverage"
|
20
|
+
|
21
|
+
FileUtils.remove_dir(code_coverage_directory, true)
|
22
|
+
end
|
23
|
+
|
24
|
+
desc 'Check documentation with RDoc'
|
25
|
+
task :check_documentation do
|
26
|
+
output = `rdoc lib -C`
|
27
|
+
puts output
|
28
|
+
|
29
|
+
if output =~ /100.00% documented/
|
30
|
+
puts Rainbow('All code documented').green
|
31
|
+
else
|
32
|
+
raise Rainbow('Parts of the gem are undocumented').red
|
33
|
+
end
|
34
|
+
end
|
35
|
+
|
36
|
+
desc 'Check documentation with RDoc'
|
37
|
+
task :check_for_outdated_dependencies do
|
38
|
+
output = `bundle outdated`
|
39
|
+
puts output
|
40
|
+
|
41
|
+
if output =~ /requested/
|
42
|
+
raise Rainbow('Some dependencies are out of date!').red
|
43
|
+
else
|
44
|
+
puts Rainbow('All direct dependencies up to date!').green
|
45
|
+
end
|
46
|
+
end
|
47
|
+
|
48
|
+
desc 'Run all of the tests'
|
49
|
+
task :test_everything => [:clear_coverage] do
|
50
|
+
rspec_args = '--tag ~@wip --pattern "spec/**/*_spec.rb" --force-color'
|
51
|
+
|
52
|
+
cucumber_version = Gem.loaded_specs['cucumber'].version.version
|
53
|
+
|
54
|
+
if cucumber_version =~ /^[123]\./
|
55
|
+
cucumber_args = 'features -f progress -t ~@wip --color'
|
56
|
+
else
|
57
|
+
cucumber_args = "features -f progress -t 'not @wip' --color"
|
58
|
+
end
|
59
|
+
|
60
|
+
Rake::Task['racatt:test_everything'].invoke(rspec_args, cucumber_args)
|
61
|
+
end
|
62
|
+
|
63
|
+
# creates coveralls:push task
|
64
|
+
Coveralls::RakeTask.new
|
65
|
+
|
66
|
+
desc 'The task that CI will run. Do not run locally.'
|
67
|
+
task :ci_build => ['cuke_slicer:test_everything', 'coveralls:push']
|
68
|
+
|
69
|
+
desc 'Check that things look good before trying to release'
|
70
|
+
task :prerelease_check do
|
71
|
+
begin
|
72
|
+
Rake::Task['cuke_slicer:test_everything'].invoke
|
73
|
+
Rake::Task['cuke_slicer:check_documentation'].invoke
|
74
|
+
rescue => e
|
75
|
+
puts Rainbow("Something isn't right!").red
|
76
|
+
raise e
|
77
|
+
end
|
78
|
+
|
79
|
+
puts Rainbow('All is well. :)').green
|
80
|
+
end
|
81
|
+
|
82
|
+
end
|
83
|
+
|
84
|
+
|
85
|
+
task :default => 'cuke_slicer:test_everything'
|
data/appveyor.yml
ADDED
@@ -0,0 +1,81 @@
|
|
1
|
+
version: '1.0.{build}'
|
2
|
+
|
3
|
+
environment:
|
4
|
+
matrix:
|
5
|
+
|
6
|
+
- RUBY_VERSION: 193
|
7
|
+
BUNDLE_GEMFILE: gemfiles/cuke_modeler0.gemfile
|
8
|
+
# AppVeyor does not have a 64-bit Ruby 1.9.3
|
9
|
+
- RUBY_VERSION: 23
|
10
|
+
BUNDLE_GEMFILE: gemfiles/cuke_modeler0.gemfile
|
11
|
+
- RUBY_VERSION: 23-x64
|
12
|
+
BUNDLE_GEMFILE: gemfiles/cuke_modeler0.gemfile
|
13
|
+
- RUBY_VERSION: 24
|
14
|
+
BUNDLE_GEMFILE: gemfiles/cuke_modeler0.gemfile
|
15
|
+
- RUBY_VERSION: 24-x64
|
16
|
+
BUNDLE_GEMFILE: gemfiles/cuke_modeler0.gemfile
|
17
|
+
- RUBY_VERSION: 25
|
18
|
+
BUNDLE_GEMFILE: gemfiles/cuke_modeler0.gemfile
|
19
|
+
- RUBY_VERSION: 25-x64
|
20
|
+
BUNDLE_GEMFILE: gemfiles/cuke_modeler0.gemfile
|
21
|
+
|
22
|
+
- RUBY_VERSION: 193
|
23
|
+
BUNDLE_GEMFILE: gemfiles/cuke_modeler1.gemfile
|
24
|
+
# AppVeyor does not have a 64-bit Ruby 1.9.3
|
25
|
+
- RUBY_VERSION: 23
|
26
|
+
BUNDLE_GEMFILE: gemfiles/cuke_modeler1.gemfile
|
27
|
+
- RUBY_VERSION: 23-x64
|
28
|
+
BUNDLE_GEMFILE: gemfiles/cuke_modeler1.gemfile
|
29
|
+
- RUBY_VERSION: 24
|
30
|
+
BUNDLE_GEMFILE: gemfiles/cuke_modeler1.gemfile
|
31
|
+
- RUBY_VERSION: 24-x64
|
32
|
+
BUNDLE_GEMFILE: gemfiles/cuke_modeler1.gemfile
|
33
|
+
- RUBY_VERSION: 25
|
34
|
+
BUNDLE_GEMFILE: gemfiles/cuke_modeler1.gemfile
|
35
|
+
- RUBY_VERSION: 25-x64
|
36
|
+
BUNDLE_GEMFILE: gemfiles/cuke_modeler1.gemfile
|
37
|
+
|
38
|
+
- RUBY_VERSION: 193
|
39
|
+
BUNDLE_GEMFILE: gemfiles/cuke_modeler2.gemfile
|
40
|
+
# AppVeyor does not have a 64-bit Ruby 1.9.3
|
41
|
+
- RUBY_VERSION: 23
|
42
|
+
BUNDLE_GEMFILE: gemfiles/cuke_modeler2.gemfile
|
43
|
+
- RUBY_VERSION: 23-x64
|
44
|
+
BUNDLE_GEMFILE: gemfiles/cuke_modeler2.gemfile
|
45
|
+
- RUBY_VERSION: 24
|
46
|
+
BUNDLE_GEMFILE: gemfiles/cuke_modeler2.gemfile
|
47
|
+
- RUBY_VERSION: 24-x64
|
48
|
+
BUNDLE_GEMFILE: gemfiles/cuke_modeler2.gemfile
|
49
|
+
- RUBY_VERSION: 25
|
50
|
+
BUNDLE_GEMFILE: gemfiles/cuke_modeler2.gemfile
|
51
|
+
- RUBY_VERSION: 25-x64
|
52
|
+
BUNDLE_GEMFILE: gemfiles/cuke_modeler2.gemfile
|
53
|
+
|
54
|
+
# CukeModeler 3.x requires at least Ruby 2.3
|
55
|
+
- RUBY_VERSION: 23
|
56
|
+
BUNDLE_GEMFILE: gemfiles/cuke_modeler3.gemfile
|
57
|
+
- RUBY_VERSION: 23-x64
|
58
|
+
BUNDLE_GEMFILE: gemfiles/cuke_modeler3.gemfile
|
59
|
+
- RUBY_VERSION: 24
|
60
|
+
BUNDLE_GEMFILE: gemfiles/cuke_modeler3.gemfile
|
61
|
+
- RUBY_VERSION: 24-x64
|
62
|
+
BUNDLE_GEMFILE: gemfiles/cuke_modeler3.gemfile
|
63
|
+
- RUBY_VERSION: 25
|
64
|
+
BUNDLE_GEMFILE: gemfiles/cuke_modeler3.gemfile
|
65
|
+
- RUBY_VERSION: 25-x64
|
66
|
+
BUNDLE_GEMFILE: gemfiles/cuke_modeler3.gemfile
|
67
|
+
|
68
|
+
|
69
|
+
install:
|
70
|
+
- set PATH=C:\Ruby%RUBY_VERSION%\bin;%PATH%
|
71
|
+
- bundle install
|
72
|
+
|
73
|
+
build: off
|
74
|
+
|
75
|
+
before_test:
|
76
|
+
- ruby -v
|
77
|
+
- gem -v
|
78
|
+
- bundle -v
|
79
|
+
|
80
|
+
test_script:
|
81
|
+
- bundle exec rake cuke_slicer:ci_build
|
data/cuke_slicer.gemspec
CHANGED
@@ -9,8 +9,8 @@ Gem::Specification.new do |spec|
|
|
9
9
|
spec.authors = ["Eric Kessler"]
|
10
10
|
spec.email = ["morrow748@gmail.com"]
|
11
11
|
spec.summary = %q{A gem for extracting test cases from a Cucumber test suite.}
|
12
|
-
spec.description =
|
13
|
-
spec.homepage = ""
|
12
|
+
spec.description = %q{Slices a Cucumber test suite into the smallest possible executable pieces (i.e. scenarios and individual outline example rows. These pieces can then be more easily used for running tests in parallel.}
|
13
|
+
spec.homepage = "https://github.com/enkessler/cuke_slicer"
|
14
14
|
spec.license = "MIT"
|
15
15
|
|
16
16
|
spec.files = `git ls-files -z`.split("\x0")
|
@@ -18,11 +18,17 @@ Gem::Specification.new do |spec|
|
|
18
18
|
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
19
19
|
spec.require_paths = ["lib"]
|
20
20
|
|
21
|
-
spec.
|
21
|
+
spec.required_ruby_version = '>= 1.9.3', '< 4.0'
|
22
22
|
|
23
|
-
spec.
|
24
|
-
|
23
|
+
spec.add_runtime_dependency "cuke_modeler", "< 4.0"
|
24
|
+
|
25
|
+
spec.add_development_dependency 'bundler', '< 3.0'
|
26
|
+
spec.add_development_dependency 'rake', '< 13.0.0'
|
25
27
|
spec.add_development_dependency "rspec", '~> 3.0'
|
26
|
-
spec.add_development_dependency
|
27
|
-
spec.add_development_dependency
|
28
|
+
spec.add_development_dependency 'cucumber', '< 5.0.0'
|
29
|
+
spec.add_development_dependency 'simplecov', '<= 0.16.1' # Coveralls gem does not support any newer version than this
|
30
|
+
spec.add_development_dependency "racatt", '~> 1.0'
|
31
|
+
spec.add_development_dependency 'coveralls', '< 1.0.0'
|
32
|
+
spec.add_development_dependency 'rainbow', '< 4.0.0'
|
33
|
+
|
28
34
|
end
|
@@ -7,16 +7,17 @@ When(/^test cases are extracted from "([^"]*)"$/) do |target|
|
|
7
7
|
filters[:excluded_paths] = @excluded_path_filters if @excluded_path_filters
|
8
8
|
filters[:included_paths] = @included_path_filters if @included_path_filters
|
9
9
|
|
10
|
-
@output[target] = CukeSlicer::Slicer.new.slice("#{@default_file_directory}/#{target}", filters, &@custom_filter)
|
10
|
+
@output[target] = CukeSlicer::Slicer.new.slice("#{@default_file_directory}/#{target}", filters, :file_line, &@custom_filter)
|
11
11
|
end
|
12
12
|
|
13
13
|
When(/^test cases are extracted from it$/) do
|
14
14
|
@output ||= {}
|
15
15
|
filters = {}
|
16
16
|
target = @targets.first
|
17
|
+
@output_type ||= :file_line
|
17
18
|
|
18
19
|
begin
|
19
|
-
@output[target] = CukeSlicer::Slicer.new.slice("#{@default_file_directory}/#{target}", filters)
|
20
|
+
@output[target] = CukeSlicer::Slicer.new.slice("#{@default_file_directory}/#{target}", filters, @output_type)
|
20
21
|
rescue ArgumentError => e
|
21
22
|
@error_raised = e
|
22
23
|
end
|
@@ -27,7 +28,7 @@ When(/^test cases are extracted from them$/) do
|
|
27
28
|
filters = {}
|
28
29
|
|
29
30
|
@targets.each do |target|
|
30
|
-
@output[target] = CukeSlicer::Slicer.new.slice("#{@default_file_directory}/#{target}", filters)
|
31
|
+
@output[target] = CukeSlicer::Slicer.new.slice("#{@default_file_directory}/#{target}", filters, :file_line)
|
31
32
|
end
|
32
33
|
end
|
33
34
|
|
@@ -37,7 +38,7 @@ When(/^test cases are extracted from "([^"]*)" using the following exclusive tag
|
|
37
38
|
|
38
39
|
options[:excluded_tags] = filters.raw.flatten.collect { |filter| process_filter(filter) }
|
39
40
|
|
40
|
-
@output[target] = CukeSlicer::Slicer.new.slice("#{@default_file_directory}/#{target}", options)
|
41
|
+
@output[target] = CukeSlicer::Slicer.new.slice("#{@default_file_directory}/#{target}", options, :file_line)
|
41
42
|
end
|
42
43
|
|
43
44
|
When(/^test cases are extracted from "([^"]*)" using the following inclusive tag filters:$/) do |target, filters|
|
@@ -46,7 +47,7 @@ When(/^test cases are extracted from "([^"]*)" using the following inclusive tag
|
|
46
47
|
|
47
48
|
options[:included_tags] = filters.raw.flatten.collect { |filter| process_filter(filter) }
|
48
49
|
|
49
|
-
@output[target] = CukeSlicer::Slicer.new.slice("#{@default_file_directory}/#{target}", options)
|
50
|
+
@output[target] = CukeSlicer::Slicer.new.slice("#{@default_file_directory}/#{target}", options, :file_line)
|
50
51
|
end
|
51
52
|
|
52
53
|
When(/^test cases are extracted from "([^"]*)" using the following inclusive path filters:$/) do |target, filters|
|
@@ -55,7 +56,7 @@ When(/^test cases are extracted from "([^"]*)" using the following inclusive pat
|
|
55
56
|
|
56
57
|
options[:included_paths] = filters.raw.flatten.collect { |filter| process_filter(filter) }
|
57
58
|
|
58
|
-
@output[target] = CukeSlicer::Slicer.new.slice("#{@default_file_directory}/#{target}", options)
|
59
|
+
@output[target] = CukeSlicer::Slicer.new.slice("#{@default_file_directory}/#{target}", options, :file_line)
|
59
60
|
end
|
60
61
|
|
61
62
|
When(/^test cases are extracted from "([^"]*)" using the following exclusive path filters:$/) do |target, filters|
|
@@ -64,7 +65,7 @@ When(/^test cases are extracted from "([^"]*)" using the following exclusive pat
|
|
64
65
|
|
65
66
|
options[:excluded_paths] = filters.raw.flatten.collect { |filter| process_filter(filter) }
|
66
67
|
|
67
|
-
@output[target] = CukeSlicer::Slicer.new.slice("#{@default_file_directory}/#{target}", options)
|
68
|
+
@output[target] = CukeSlicer::Slicer.new.slice("#{@default_file_directory}/#{target}", options, :file_line)
|
68
69
|
end
|
69
70
|
|
70
71
|
When(/^test cases are extracted from "([^"]*)" using the following custom filter:$/) do |target, filter_block|
|
@@ -72,7 +73,7 @@ When(/^test cases are extracted from "([^"]*)" using the following custom filter
|
|
72
73
|
|
73
74
|
custom_filter = eval("Proc.new #{filter_block}")
|
74
75
|
|
75
|
-
@output[target] = CukeSlicer::Slicer.new.slice("#{@default_file_directory}/#{target}", &custom_filter)
|
76
|
+
@output[target] = CukeSlicer::Slicer.new.slice("#{@default_file_directory}/#{target}", :file_line, &custom_filter)
|
76
77
|
end
|
77
78
|
|
78
79
|
When(/^test cases are extracted from "([^"]*)" using "([^"]*)"$/) do |target, included_tag_filters|
|
@@ -81,7 +82,7 @@ When(/^test cases are extracted from "([^"]*)" using "([^"]*)"$/) do |target, in
|
|
81
82
|
|
82
83
|
options[:included_tags] = eval("[#{included_tag_filters}]")
|
83
84
|
|
84
|
-
@output[target] = CukeSlicer::Slicer.new.slice("#{@default_file_directory}/#{target}", options)
|
85
|
+
@output[target] = CukeSlicer::Slicer.new.slice("#{@default_file_directory}/#{target}", options, :file_line)
|
85
86
|
end
|
86
87
|
|
87
88
|
def process_filter(filter)
|
@@ -91,7 +92,7 @@ end
|
|
91
92
|
|
92
93
|
When(/^it tries to extract test cases using an unknown filter type$/) do
|
93
94
|
begin
|
94
|
-
@slicer.slice(@default_file_directory, {unknown_filter: 'foo'})
|
95
|
+
@slicer.slice(@default_file_directory, {unknown_filter: 'foo'}, :file_line)
|
95
96
|
rescue ArgumentError => e
|
96
97
|
@error_raised = e
|
97
98
|
end
|
@@ -99,7 +100,7 @@ end
|
|
99
100
|
|
100
101
|
When(/^it tries to extract test cases using an invalid filter$/) do
|
101
102
|
begin
|
102
|
-
@slicer.slice(@default_file_directory, {included_tags: 7})
|
103
|
+
@slicer.slice(@default_file_directory, {included_tags: 7}, :file_line)
|
103
104
|
rescue ArgumentError => e
|
104
105
|
@error_raised = e
|
105
106
|
end
|