cuke_slicer 2.0.2 → 2.0.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: 63fcae8bc8d4f628f33887c70a7984314f738300
4
- data.tar.gz: 7d216806f79b2eebbe730a68ae8a9c43bf46a99b
2
+ SHA256:
3
+ metadata.gz: 6f68cb4388cfd8699d8470ef921c5d18325eb4165f70f4bb25ee7e0d4dc90cc9
4
+ data.tar.gz: 6172e49cc4f8354c7da41a79c98276ebf8a68be81fdad52569168336c8fc742c
5
5
  SHA512:
6
- metadata.gz: 9bd87c050c7279636cf8731b7548567b8a51c6e4a09f636a3f011f11410d8eb6ee4b349509cf4607d8343f29a1a7cd73d97f598e5ae3862ffa606cfa9f631b83
7
- data.tar.gz: 9729d25fbc411539bb8b8d42a516bc52dc5f963d101b30c27cffb3b64f30cee9eb90ee6a67c1c7ebd8fd02dde6e1bc685beff273889b2579726e2534f5833653
6
+ metadata.gz: 2780dfff1b2265d8071aeb25f9ef4f0b491173cec2f182742a781e65c0b9a7d92b4a1c7c3b2fe73d4bf5d304b0aec6609be695b910e08e8c5379c0125a4ce938
7
+ data.tar.gz: c959ecc7caba34bb4ec124bd0e880ee0772bdeabeb9dd5f2b6b684051a79d07e059a8b30853c35ec16d6b6ada8ac75269873bef952999b5ac2d47b5dd0568224
data/.gitignore CHANGED
@@ -20,3 +20,5 @@ tmp
20
20
  *.o
21
21
  *.a
22
22
  mkmf.log
23
+ .idea/*
24
+
data/.travis.yml CHANGED
@@ -1,11 +1,25 @@
1
+ os:
2
+ - linux
3
+ - osx
4
+
1
5
  language: ruby
2
6
  rvm:
3
7
  - 1.9.3
4
- - 2.0.0
5
- - 2.1.2
8
+ - 2.3.8
9
+ - 2.4.5
10
+ - 2.5.3
11
+ - 2.6.0
12
+ - jruby-9.1.7.0
6
13
 
7
14
  gemfile:
8
15
  - gemfiles/cuke_modeler0.gemfile
9
16
  - gemfiles/cuke_modeler1.gemfile
10
17
 
18
+ matrix:
19
+ exclude:
20
+ # Travis does not provide 1.9.3 on OSX
21
+ - rvm: 1.9.3
22
+ os: osx
23
+
24
+
11
25
  script: bundle exec rake cuke_slicer:ci_build
data/CHANGELOG.md ADDED
@@ -0,0 +1,56 @@
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
+
12
+ ## [2.0.3] - 2019-05-01
13
+
14
+ ### Added
15
+
16
+ - Add dependency version limits to Ruby, which was previously unbound. Previously unofficially supported Ruby versions (1.9.3 - 2.x) are now officially supported.
17
+
18
+
19
+ ## [2.0.2] - 2016-11-19
20
+
21
+ ### Added
22
+
23
+ - The gem now declares version limits for all of its dependencies.
24
+
25
+
26
+ ## [2.0.1] - 2016-11-08 (yanked)
27
+
28
+ ### Added
29
+
30
+ - Works with both 0.x and 1.x versions of the 'cuke_modeler' gem.
31
+
32
+
33
+ ## [2.0.0] - 2015-07-08
34
+
35
+ ### Added
36
+
37
+ - When slicing a directory, the test cases returned can now be provided as model objects in addition to the
38
+ previous 'file_path:line_number' format.
39
+
40
+ ### Changed
41
+
42
+ - Major performance increase
43
+
44
+
45
+ ## [1.0.0] - 2015-04-01
46
+
47
+ ### Added
48
+
49
+ - Initial release
50
+
51
+ [Unreleased]: https://github.com/grange-insurance/cuke_slicer/compare/v2.0.3...HEAD
52
+ [2.0.3]: https://github.com/grange-insurance/cuke_slicer/compare/v2.0.2...v2.0.3
53
+ [2.0.2]: https://github.com/grange-insurance/cuke_slicer/compare/v2.0.1...v2.0.2
54
+ [2.0.1]: https://github.com/grange-insurance/cuke_slicer/compare/v2.0.0...v2.0.1
55
+ [2.0.0]: https://github.com/grange-insurance/cuke_slicer/compare/v1.0.0...v2.0.0
56
+ [1.0.0]: https://github.com/grange-insurance/cuke_slicer/compare/1c6e64b963d97f9037f1dc1ebcb6f8f9966f3b71...v1.0.0
data/LICENSE.txt CHANGED
@@ -1,4 +1,4 @@
1
- Copyright (c) 2015 Grange Insurance
1
+ Copyright (c) 2015-2019 Grange Insurance
2
2
 
3
3
  MIT License
4
4
 
data/README.md CHANGED
@@ -1,17 +1,20 @@
1
- # CukeSlicer
2
-
3
- <a href="http://badge.fury.io/rb/cuke_slicer"><img src="https://badge.fury.io/rb/cuke_slicer.svg" alt="Gem Version"></a>
1
+ Basic stuff:
2
+ [![Gem Version](https://badge.fury.io/rb/cuke_slicer.svg)](https://rubygems.org/gems/cuke_slicer)
3
+ [![Project License](https://img.shields.io/badge/license-MIT-blue.svg)](https://opensource.org/licenses/mit-license.php)
4
+ [![Downloads](https://img.shields.io/gem/dt/cuke_slicer.svg)](https://rubygems.org/gems/cuke_slicer)
4
5
 
5
- <a href='https://gemnasium.com/grange-insurance/cuke_slicer'><img src="https://gemnasium.com/grange-insurance/cuke_slicer.svg" alt="Dependency Status" /></a>
6
+ User stuff:
7
+ [![Yard Docs](http://img.shields.io/badge/Documentation-API-blue.svg)](https://www.rubydoc.info/gems/cuke_slicer)
6
8
 
7
- <a href='https://github.com/grange-insurance/cuke_slicer/blob/master/LICENSE.txt'><img src="https://img.shields.io/badge/license-MIT-blue.svg" alt="Project License" /></a>
9
+ Developer stuff:
10
+ [![Build Status](https://travis-ci.org//grange-insurance/cuke_slicer.svg?branch=dev)](https://travis-ci.org/grange-insurance/cuke_slicer)
11
+ [![Coverage Status](https://coveralls.io/repos/github/grange-insurance/cuke_slicer/badge.svg?branch=dev)](https://coveralls.io/github/grange-insurance/cuke_slicer?branch=dev)
12
+ [![Maintainability](https://codeclimate.com/github/grange-insurance/cuke_slicer/badges/gpa.svg)](https://codeclimate.com/github/grange-insurance/cuke_slicer/maintainability)
8
13
 
9
- <a href="https://travis-ci.org/grange-insurance/cuke_slicer"><img src="https://travis-ci.org/grange-insurance/cuke_slicer.svg" alt="Build Status"></a>
14
+ ---
10
15
 
11
- <a href='https://coveralls.io/r/grange-insurance/cuke_slicer'><img src='https://coveralls.io/repos/grange-insurance/cuke_slicer/badge.svg' alt='Coverage Status' /></a>
12
-
13
- <a href="https://codeclimate.com/github/grange-insurance/cuke_slicer"><img src="https://codeclimate.com/github/grange-insurance/cuke_slicer/badges/gpa.svg" alt="Code Quality" /></a>
14
16
 
17
+ # CukeSlicer
15
18
 
16
19
  The cuke_slicer gem provides an easy and programmatic way to divide a Cucumber test suite into granular test
17
20
  cases that can then be dealt with on an individual basis. Often this means handing them off to a distributed
data/Rakefile CHANGED
@@ -1,26 +1,83 @@
1
- require "bundler/gem_tasks"
2
- require 'coveralls/rake/task'
1
+ require 'bundler/gem_tasks'
2
+ require 'rake'
3
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
4
13
 
5
14
 
6
15
  namespace 'cuke_slicer' do
7
16
 
17
+ desc 'Removes the current code coverage data'
8
18
  task :clear_coverage do
9
- puts 'Clearing old code coverage results...'
19
+ code_coverage_directory = "#{File.dirname(__FILE__)}/coverage"
10
20
 
11
- # Remove previous coverage results so that they don't get merged in the new results
12
- code_coverage_directory = File.join(File.dirname(__FILE__), 'coverage')
13
- FileUtils.remove_dir(code_coverage_directory, true) if File.exists?(code_coverage_directory)
21
+ FileUtils.remove_dir(code_coverage_directory, true)
14
22
  end
15
23
 
16
- Racatt.create_tasks
24
+ desc 'Check documentation with RDoc'
25
+ task :check_documentation do
26
+ output = `rdoc lib -C`
27
+ puts output
17
28
 
18
- # Redefining the task from 'racatt' in order to clear the code coverage results
19
- task :test_everything, [:command_options] => :clear_coverage
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
20
35
 
21
- # The task that CI will use
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
22
64
  Coveralls::RakeTask.new
23
- task :ci_build => [:clear_coverage, :test_everything, 'coveralls:push']
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
24
81
 
25
82
  end
26
83
 
data/cuke_slicer.gemspec CHANGED
@@ -18,14 +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.required_ruby_version = '>= 1.9.3', '< 3.0'
22
+
21
23
  spec.add_runtime_dependency "cuke_modeler", "< 2.0"
22
24
 
23
- spec.add_development_dependency "bundler", "~> 1.6"
24
- spec.add_development_dependency "rake" , '~> 11.0'
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 "cucumber", '~> 2.0'
28
+ spec.add_development_dependency 'cucumber', '< 5.0.0'
27
29
  spec.add_development_dependency "simplecov", '~> 0.0'
28
30
  spec.add_development_dependency "racatt", '~> 1.0'
29
31
  spec.add_development_dependency 'coveralls', '< 1.0.0'
32
+ spec.add_development_dependency 'rainbow', '< 4.0.0'
30
33
 
31
34
  end
@@ -2,10 +2,13 @@ source 'https://rubygems.org'
2
2
 
3
3
  gemspec :path => "../"
4
4
 
5
- gem 'cuke_modeler', '~> 0.0'
5
+ # Bundle is not using the latest in the CukeModeler 0.x series for some reason, so being explicit here
6
+ gem 'cuke_modeler', '0.4.1'
7
+ # gem 'cuke_modeler', '~> 0.0' # This really should be sufficient...
6
8
 
7
9
 
8
10
  if RUBY_VERSION =~ /^1\./
11
+ gem 'cucumber', '< 3.0.0' # Ruby 1.9.x support dropped after this version
9
12
  gem 'json', '< 2.0' # The 'json' gem drops pre-Ruby 2.x support on/after this version
10
13
  gem 'tins', '< 1.7' # The 'tins' gem requires Ruby 2.x on/after this version
11
14
  gem 'term-ansicolor', '< 1.4' # The 'term-ansicolor' gem requires Ruby 2.x on/after this version
@@ -6,6 +6,7 @@ gem 'cuke_modeler', '~> 1.0'
6
6
 
7
7
 
8
8
  if RUBY_VERSION =~ /^1\./
9
+ gem 'cucumber', '< 3.0.0' # Ruby 1.9.x support dropped after this version
9
10
  gem 'json', '< 2.0' # The 'json' gem drops pre-Ruby 2.x support on/after this version
10
11
  gem 'tins', '< 1.7' # The 'tins' gem requires Ruby 2.x on/after this version
11
12
  gem 'term-ansicolor', '< 1.4' # The 'term-ansicolor' gem requires Ruby 2.x on/after this version
@@ -1,6 +1,8 @@
1
1
  require "cuke_slicer/helpers/helpers"
2
2
 
3
3
 
4
+ # Internal helper module that is not part of the public API. Subject to change at any time.
5
+ # :nodoc: all
4
6
  module CukeSlicer
5
7
  class NestedTagCollection
6
8
 
@@ -1,6 +1,8 @@
1
1
  require "cuke_slicer/helpers/helpers"
2
2
 
3
3
 
4
+ # Internal helper module that is not part of the public API. Subject to change at any time.
5
+ # :nodoc: all
4
6
  module CukeSlicer
5
7
  class PathCollection
6
8
 
@@ -2,6 +2,8 @@ require "cuke_slicer/helpers/helpers"
2
2
  require "cuke_slicer/collections/nested_tag_collection"
3
3
 
4
4
 
5
+ # Internal helper module that is not part of the public API. Subject to change at any time.
6
+ # :nodoc: all
5
7
  module CukeSlicer
6
8
  class TagCollection
7
9
 
@@ -1,3 +1,5 @@
1
+ # Internal helper module that is not part of the public API. Subject to change at any time.
2
+ # :nodoc: all
1
3
  module CukeSlicer
2
4
  class DirectoryExtractor
3
5
 
@@ -3,6 +3,8 @@ require "cuke_slicer/helpers/filter_helpers"
3
3
  require "cuke_slicer/helpers/extraction_helpers"
4
4
 
5
5
 
6
+ # Internal helper module that is not part of the public API. Subject to change at any time.
7
+ # :nodoc: all
6
8
  module CukeSlicer
7
9
  class FileExtractor
8
10
 
@@ -3,6 +3,8 @@ require "cuke_slicer/collections/tag_collection"
3
3
  require "cuke_slicer/collections/path_collection"
4
4
 
5
5
 
6
+ # Internal helper module that is not part of the public API. Subject to change at any time.
7
+ # :nodoc: all
6
8
  module CukeSlicer
7
9
  class FilterSet
8
10
 
@@ -1,3 +1,5 @@
1
+ # Internal helper module that is not part of the public API. Subject to change at any time.
2
+ # :nodoc: all
1
3
  module CukeSlicer
2
4
  module ExtractionHelpers
3
5
 
@@ -1,3 +1,5 @@
1
+ # Internal helper module that is not part of the public API. Subject to change at any time.
2
+ # :nodoc: all
1
3
  module CukeSlicer
2
4
  module FilterHelpers
3
5
 
@@ -1,3 +1,5 @@
1
+ # Internal helper module that is not part of the public API. Subject to change at any time.
2
+ # :nodoc: all
1
3
  module CukeSlicer
2
4
  module Helpers
3
5
 
@@ -1,3 +1,5 @@
1
+ # Internal helper module that is not part of the public API. Subject to change at any time.
2
+ # :nodoc: all
1
3
  module CukeSlicer
2
4
  module MatchingHelpers
3
5
 
@@ -1,4 +1,4 @@
1
1
  module CukeSlicer
2
2
  # The current version for the gem.
3
- VERSION = "2.0.2"
3
+ VERSION = "2.0.3"
4
4
  end
@@ -92,6 +92,43 @@ describe 'Slicer, Integration' do
92
92
  expect { slicer.slice(test_file, :file_line) }.to raise_error(ArgumentError, /syntax.*lexing problem.*#{test_file}/i)
93
93
  end
94
94
 
95
+ it 'does not swallow unexpected exceptions while slicing' do
96
+ begin
97
+ $old_method = CukeModeler::Parsing.method(:parse_text)
98
+
99
+ # Custom error type in order to ensure that we are throwing the correct thing
100
+ module CukeSlicer
101
+ class TestError < StandardError
102
+ end
103
+ end
104
+
105
+ # Monkey patch the parsing method to throw the error that we need for testing
106
+ module CukeModeler
107
+ module Parsing
108
+ class << self
109
+ def parse_text(*args)
110
+ raise(CukeSlicer::TestError, 'something went wrong')
111
+ end
112
+ end
113
+ end
114
+ end
115
+
116
+
117
+ File.write(test_file, 'junk text')
118
+
119
+ expect { slicer.slice(test_file, :file_line) }.to raise_error(CukeSlicer::TestError, 'something went wrong')
120
+ ensure
121
+ # Making sure that our changes don't escape a test and ruin the rest of the suite
122
+ module CukeModeler
123
+ module Parsing
124
+ class << self
125
+ define_method(:parse_text, $old_method)
126
+ end
127
+ end
128
+ end
129
+ end
130
+ end
131
+
95
132
  end
96
133
 
97
134
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cuke_slicer
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.2
4
+ version: 2.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Eric Kessler
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-11-19 00:00:00.000000000 Z
11
+ date: 2019-05-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: cuke_modeler
@@ -28,30 +28,30 @@ dependencies:
28
28
  name: bundler
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - "~>"
31
+ - - "<"
32
32
  - !ruby/object:Gem::Version
33
- version: '1.6'
33
+ version: '3.0'
34
34
  type: :development
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
- - - "~>"
38
+ - - "<"
39
39
  - !ruby/object:Gem::Version
40
- version: '1.6'
40
+ version: '3.0'
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: rake
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
- - - "~>"
45
+ - - "<"
46
46
  - !ruby/object:Gem::Version
47
- version: '11.0'
47
+ version: 13.0.0
48
48
  type: :development
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
- - - "~>"
52
+ - - "<"
53
53
  - !ruby/object:Gem::Version
54
- version: '11.0'
54
+ version: 13.0.0
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: rspec
57
57
  requirement: !ruby/object:Gem::Requirement
@@ -70,16 +70,16 @@ dependencies:
70
70
  name: cucumber
71
71
  requirement: !ruby/object:Gem::Requirement
72
72
  requirements:
73
- - - "~>"
73
+ - - "<"
74
74
  - !ruby/object:Gem::Version
75
- version: '2.0'
75
+ version: 5.0.0
76
76
  type: :development
77
77
  prerelease: false
78
78
  version_requirements: !ruby/object:Gem::Requirement
79
79
  requirements:
80
- - - "~>"
80
+ - - "<"
81
81
  - !ruby/object:Gem::Version
82
- version: '2.0'
82
+ version: 5.0.0
83
83
  - !ruby/object:Gem::Dependency
84
84
  name: simplecov
85
85
  requirement: !ruby/object:Gem::Requirement
@@ -122,6 +122,20 @@ dependencies:
122
122
  - - "<"
123
123
  - !ruby/object:Gem::Version
124
124
  version: 1.0.0
125
+ - !ruby/object:Gem::Dependency
126
+ name: rainbow
127
+ requirement: !ruby/object:Gem::Requirement
128
+ requirements:
129
+ - - "<"
130
+ - !ruby/object:Gem::Version
131
+ version: 4.0.0
132
+ type: :development
133
+ prerelease: false
134
+ version_requirements: !ruby/object:Gem::Requirement
135
+ requirements:
136
+ - - "<"
137
+ - !ruby/object:Gem::Version
138
+ version: 4.0.0
125
139
  description: A gem for extracting test cases from a Cucumber test suite.
126
140
  email:
127
141
  - morrow748@gmail.com
@@ -132,8 +146,8 @@ files:
132
146
  - ".gitignore"
133
147
  - ".simplecov"
134
148
  - ".travis.yml"
149
+ - CHANGELOG.md
135
150
  - Gemfile
136
- - History.rdoc
137
151
  - LICENSE.txt
138
152
  - README.md
139
153
  - Rakefile
@@ -177,7 +191,10 @@ required_ruby_version: !ruby/object:Gem::Requirement
177
191
  requirements:
178
192
  - - ">="
179
193
  - !ruby/object:Gem::Version
180
- version: '0'
194
+ version: 1.9.3
195
+ - - "<"
196
+ - !ruby/object:Gem::Version
197
+ version: '3.0'
181
198
  required_rubygems_version: !ruby/object:Gem::Requirement
182
199
  requirements:
183
200
  - - ">="
@@ -185,7 +202,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
185
202
  version: '0'
186
203
  requirements: []
187
204
  rubyforge_project:
188
- rubygems_version: 2.6.7
205
+ rubygems_version: 2.7.6
189
206
  signing_key:
190
207
  specification_version: 4
191
208
  summary: A gem for extracting test cases from a Cucumber test suite.
data/History.rdoc DELETED
@@ -1,19 +0,0 @@
1
- === Version 2.0.2 / 2016-11-19
2
-
3
- * The gem now declares version limits for all of its dependencies.
4
-
5
- === Version 2.0.1 / 2016-11-08
6
-
7
- * Works with both 0.x and 1.x versions of the 'cuke_modeler' gem.
8
-
9
- === Version 2.0.0 / 2015-07-08
10
-
11
- * When slicing a directory, the test cases returned can now be provided as model objects in addition to the
12
- previous 'file_path:line_number' format.
13
-
14
- * Major performance increase
15
-
16
-
17
- === Version 1.0.0 / 2015-04-01
18
-
19
- * Initial release