Skip to content

Commit

Permalink
Merge e7b8fb4 into 34e1f9e
Browse files Browse the repository at this point in the history
  • Loading branch information
enkessler committed May 1, 2019
2 parents 34e1f9e + e7b8fb4 commit 04f1748
Show file tree
Hide file tree
Showing 22 changed files with 237 additions and 62 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Expand Up @@ -20,3 +20,5 @@ tmp
*.o
*.a
mkmf.log
.idea/*

18 changes: 15 additions & 3 deletions .travis.yml
@@ -1,13 +1,25 @@
os:
- linux
- osx

language: ruby
rvm:
- 1.9.3
- 2.0.0
- 2.1.2
- 2.3.3
- 2.3.8
- 2.4.5
- 2.5.3
- 2.6.0
- jruby-9.1.7.0

gemfile:
- gemfiles/cuke_modeler0.gemfile
- gemfiles/cuke_modeler1.gemfile

matrix:
exclude:
# Travis does not provide 1.9.3 on OSX
- rvm: 1.9.3
os: osx


script: bundle exec rake cuke_slicer:ci_build
56 changes: 56 additions & 0 deletions CHANGELOG.md
@@ -0,0 +1,56 @@
# Changelog
All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [Unreleased]

Nothing yet...


## [2.0.3] - 2019-05-01

### Added

- Add dependency version limits to Ruby, which was previously unbound. Previously unofficially supported Ruby versions (1.9.3 - 2.x) are now officially supported.


## [2.0.2] - 2016-11-19

### Added

- The gem now declares version limits for all of its dependencies.


## [2.0.1] - 2016-11-08 (yanked)

### Added

- Works with both 0.x and 1.x versions of the 'cuke_modeler' gem.


## [2.0.0] - 2015-07-08

### Added

- When slicing a directory, the test cases returned can now be provided as model objects in addition to the
previous 'file_path:line_number' format.

### Changed

- Major performance increase


## [1.0.0] - 2015-04-01

### Added

- Initial release

[Unreleased]: https://github.com/grange-insurance/cuke_slicer/compare/v2.0.3...HEAD
[2.0.3]: https://github.com/grange-insurance/cuke_slicer/compare/v2.0.2...v2.0.3
[2.0.2]: https://github.com/grange-insurance/cuke_slicer/compare/v2.0.1...v2.0.2
[2.0.1]: https://github.com/grange-insurance/cuke_slicer/compare/v2.0.0...v2.0.1
[2.0.0]: https://github.com/grange-insurance/cuke_slicer/compare/v1.0.0...v2.0.0
[1.0.0]: https://github.com/grange-insurance/cuke_slicer/compare/1c6e64b963d97f9037f1dc1ebcb6f8f9966f3b71...v1.0.0
19 changes: 0 additions & 19 deletions History.rdoc

This file was deleted.

2 changes: 1 addition & 1 deletion LICENSE.txt
@@ -1,4 +1,4 @@
Copyright (c) 2015 Grange Insurance
Copyright (c) 2015-2019 Grange Insurance

MIT License

Expand Down
21 changes: 12 additions & 9 deletions README.md
@@ -1,17 +1,20 @@
# CukeSlicer

<a href="http://badge.fury.io/rb/cuke_slicer"><img src="https://badge.fury.io/rb/cuke_slicer.svg" alt="Gem Version"></a>
Basic stuff:
[![Gem Version](https://badge.fury.io/rb/cuke_slicer.svg)](https://rubygems.org/gems/cuke_slicer)
[![Project License](https://img.shields.io/badge/license-MIT-blue.svg)](https://opensource.org/licenses/mit-license.php)
[![Downloads](https://img.shields.io/gem/dt/cuke_slicer.svg)](https://rubygems.org/gems/cuke_slicer)

<a href='https://gemnasium.com/grange-insurance/cuke_slicer'><img src="https://gemnasium.com/grange-insurance/cuke_slicer.svg" alt="Dependency Status" /></a>
User stuff:
[![Yard Docs](http://img.shields.io/badge/Documentation-API-blue.svg)](https://www.rubydoc.info/gems/cuke_slicer)

<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>
Developer stuff:
[![Build Status](https://travis-ci.org//grange-insurance/cuke_slicer.svg?branch=dev)](https://travis-ci.org/grange-insurance/cuke_slicer)
[![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)
[![Maintainability](https://codeclimate.com/github/grange-insurance/cuke_slicer/badges/gpa.svg)](https://codeclimate.com/github/grange-insurance/cuke_slicer/maintainability)

<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>
---

<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>

<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>

# CukeSlicer

The cuke_slicer gem provides an easy and programmatic way to divide a Cucumber test suite into granular test
cases that can then be dealt with on an individual basis. Often this means handing them off to a distributed
Expand Down
79 changes: 68 additions & 11 deletions Rakefile
@@ -1,26 +1,83 @@
require "bundler/gem_tasks"
require 'coveralls/rake/task'
require 'bundler/gem_tasks'
require 'rake'
require 'racatt'
require 'coveralls/rake/task'
require 'rainbow'


Rainbow.enabled = true

namespace 'racatt' do
Racatt.create_tasks
end


namespace 'cuke_slicer' do

desc 'Removes the current code coverage data'
task :clear_coverage do
puts 'Clearing old code coverage results...'
code_coverage_directory = "#{File.dirname(__FILE__)}/coverage"

# Remove previous coverage results so that they don't get merged in the new results
code_coverage_directory = File.join(File.dirname(__FILE__), 'coverage')
FileUtils.remove_dir(code_coverage_directory, true) if File.exists?(code_coverage_directory)
FileUtils.remove_dir(code_coverage_directory, true)
end

Racatt.create_tasks
desc 'Check documentation with RDoc'
task :check_documentation do
output = `rdoc lib -C`
puts output

# Redefining the task from 'racatt' in order to clear the code coverage results
task :test_everything, [:command_options] => :clear_coverage
if output =~ /100.00% documented/
puts Rainbow('All code documented').green
else
raise Rainbow('Parts of the gem are undocumented').red
end
end

# The task that CI will use
desc 'Check documentation with RDoc'
task :check_for_outdated_dependencies do
output = `bundle outdated`
puts output

if output =~ /requested/
raise Rainbow('Some dependencies are out of date!').red
else
puts Rainbow('All direct dependencies up to date!').green
end
end

desc 'Run all of the tests'
task :test_everything => [:clear_coverage] do
rspec_args = '--tag ~@wip --pattern "spec/**/*_spec.rb" --force-color'

cucumber_version = Gem.loaded_specs['cucumber'].version.version

if cucumber_version =~ /^[123]\./
cucumber_args = 'features -f progress -t ~@wip --color'
else
cucumber_args = "features -f progress -t 'not @wip' --color"
end

Rake::Task['racatt:test_everything'].invoke(rspec_args, cucumber_args)
end

# creates coveralls:push task
Coveralls::RakeTask.new
task :ci_build => [:clear_coverage, :test_everything, 'coveralls:push']

desc 'The task that CI will run. Do not run locally.'
task :ci_build => ['cuke_slicer:test_everything', 'coveralls:push']

desc 'Check that things look good before trying to release'
task :prerelease_check do
begin
Rake::Task['cuke_slicer:test_everything'].invoke
Rake::Task['cuke_slicer:check_documentation'].invoke
rescue => e
puts Rainbow("Something isn't right!").red
raise e
end

puts Rainbow('All is well. :)').green
end

end

Expand Down
9 changes: 6 additions & 3 deletions cuke_slicer.gemspec
Expand Up @@ -18,14 +18,17 @@ Gem::Specification.new do |spec|
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
spec.require_paths = ["lib"]

spec.required_ruby_version = '>= 1.9.3', '< 3.0'

spec.add_runtime_dependency "cuke_modeler", "< 2.0"

spec.add_development_dependency "bundler", "~> 1.6"
spec.add_development_dependency "rake" , '~> 11.0'
spec.add_development_dependency 'bundler', '< 3.0'
spec.add_development_dependency 'rake', '< 13.0.0'
spec.add_development_dependency "rspec", '~> 3.0'
spec.add_development_dependency "cucumber", '~> 2.0'
spec.add_development_dependency 'cucumber', '< 5.0.0'
spec.add_development_dependency "simplecov", '~> 0.0'
spec.add_development_dependency "racatt", '~> 1.0'
spec.add_development_dependency 'coveralls', '< 1.0.0'
spec.add_development_dependency 'rainbow', '< 4.0.0'

end
20 changes: 10 additions & 10 deletions features/test_case_extraction.feature
Expand Up @@ -29,16 +29,16 @@ Feature: Test case extraction
| path/to/a_test.feature:11 |
| path/to/a_test.feature:14 |

# Scenario: Extraction from 'empty' files
# Given the following feature file "empty.feature":
# """
# Feature: Nothing here yet
# """
# And the following feature file "really_empty.feature":
# """
# """
# When test cases are extracted from them
# Then no test cases are found
Scenario: Extraction from 'empty' files
Given the following feature file "empty.feature":
"""
Feature: Nothing here yet
"""
And the following feature file "really_empty.feature":
"""
"""
When test cases are extracted from them
Then no test cases are found

Scenario: Extraction from a directory
Given the directory "test_directory"
Expand Down
5 changes: 4 additions & 1 deletion gemfiles/cuke_modeler0.gemfile
Expand Up @@ -2,10 +2,13 @@ source 'https://rubygems.org'

gemspec :path => "../"

gem 'cuke_modeler', '~> 0.0'
# Bundle is not using the latest in the CukeModeler 0.x series for some reason, so being explicit here
gem 'cuke_modeler', '0.4.1'
# gem 'cuke_modeler', '~> 0.0' # This really should be sufficient...


if RUBY_VERSION =~ /^1\./
gem 'cucumber', '< 3.0.0' # Ruby 1.9.x support dropped after this version
gem 'json', '< 2.0' # The 'json' gem drops pre-Ruby 2.x support on/after this version
gem 'tins', '< 1.7' # The 'tins' gem requires Ruby 2.x on/after this version
gem 'term-ansicolor', '< 1.4' # The 'term-ansicolor' gem requires Ruby 2.x on/after this version
Expand Down
1 change: 1 addition & 0 deletions gemfiles/cuke_modeler1.gemfile
Expand Up @@ -6,6 +6,7 @@ gem 'cuke_modeler', '~> 1.0'


if RUBY_VERSION =~ /^1\./
gem 'cucumber', '< 3.0.0' # Ruby 1.9.x support dropped after this version
gem 'json', '< 2.0' # The 'json' gem drops pre-Ruby 2.x support on/after this version
gem 'tins', '< 1.7' # The 'tins' gem requires Ruby 2.x on/after this version
gem 'term-ansicolor', '< 1.4' # The 'term-ansicolor' gem requires Ruby 2.x on/after this version
Expand Down
2 changes: 2 additions & 0 deletions lib/cuke_slicer/collections/nested_tag_collection.rb
@@ -1,6 +1,8 @@
require "cuke_slicer/helpers/helpers"


# Internal helper module that is not part of the public API. Subject to change at any time.
# :nodoc: all
module CukeSlicer
class NestedTagCollection

Expand Down
2 changes: 2 additions & 0 deletions lib/cuke_slicer/collections/path_collection.rb
@@ -1,6 +1,8 @@
require "cuke_slicer/helpers/helpers"


# Internal helper module that is not part of the public API. Subject to change at any time.
# :nodoc: all
module CukeSlicer
class PathCollection

Expand Down
2 changes: 2 additions & 0 deletions lib/cuke_slicer/collections/tag_collection.rb
Expand Up @@ -2,6 +2,8 @@
require "cuke_slicer/collections/nested_tag_collection"


# Internal helper module that is not part of the public API. Subject to change at any time.
# :nodoc: all
module CukeSlicer
class TagCollection

Expand Down
2 changes: 2 additions & 0 deletions lib/cuke_slicer/extractors/directory_extractor.rb
@@ -1,3 +1,5 @@
# Internal helper module that is not part of the public API. Subject to change at any time.
# :nodoc: all
module CukeSlicer
class DirectoryExtractor

Expand Down
2 changes: 2 additions & 0 deletions lib/cuke_slicer/extractors/file_extractor.rb
Expand Up @@ -3,6 +3,8 @@
require "cuke_slicer/helpers/extraction_helpers"


# Internal helper module that is not part of the public API. Subject to change at any time.
# :nodoc: all
module CukeSlicer
class FileExtractor

Expand Down
2 changes: 2 additions & 0 deletions lib/cuke_slicer/filters/filter_set.rb
Expand Up @@ -3,6 +3,8 @@
require "cuke_slicer/collections/path_collection"


# Internal helper module that is not part of the public API. Subject to change at any time.
# :nodoc: all
module CukeSlicer
class FilterSet

Expand Down
2 changes: 2 additions & 0 deletions lib/cuke_slicer/helpers/extraction_helpers.rb
@@ -1,3 +1,5 @@
# Internal helper module that is not part of the public API. Subject to change at any time.
# :nodoc: all
module CukeSlicer
module ExtractionHelpers

Expand Down
2 changes: 2 additions & 0 deletions lib/cuke_slicer/helpers/filter_helpers.rb
@@ -1,3 +1,5 @@
# Internal helper module that is not part of the public API. Subject to change at any time.
# :nodoc: all
module CukeSlicer
module FilterHelpers

Expand Down
2 changes: 2 additions & 0 deletions lib/cuke_slicer/helpers/helpers.rb
@@ -1,3 +1,5 @@
# Internal helper module that is not part of the public API. Subject to change at any time.
# :nodoc: all
module CukeSlicer
module Helpers

Expand Down
2 changes: 2 additions & 0 deletions lib/cuke_slicer/helpers/matching_helpers.rb
@@ -1,3 +1,5 @@
# Internal helper module that is not part of the public API. Subject to change at any time.
# :nodoc: all
module CukeSlicer
module MatchingHelpers

Expand Down

0 comments on commit 04f1748

Please sign in to comment.