spinach-rerun-reporter 0.0.2 → 1.0.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: b5d356ac8fddd00fa8f11258a48d61da4cc3fb70
4
- data.tar.gz: 9474e16584401090d95526a42b191835514bd6c8
3
+ metadata.gz: d2860ae62f77726a3a52ffd4fce6ed761b0223ee
4
+ data.tar.gz: 35cc3995f5c1ee6b439ac66c43a0804739f618f6
5
5
  SHA512:
6
- metadata.gz: 20631d113721901a3f8d19fef0e3f4743d3b68913e09adb4e8c1c2f6d6c51bbfa8edb427f2ba97e180a359557025723b39996c4211e72fd995043958cb3961ca
7
- data.tar.gz: d5b8b79f346122dd2524020718db817b2cec82798bb06935cbbc3b9fcec25f38d9ebd12bec9be33be490066a78c12aa1a8ff9c37dd4a8e60db2a30baaca7c767
6
+ metadata.gz: a1e35aef8b156caabd71d7d34206136bc1602b9df63b430b37a161244f5b9333a212adf6de39c3e8b25c21c30561c185aec975b9cb168d708d41c55312ee6ebc
7
+ data.tar.gz: d151707eb3212c0c20f9756db4109268c18763736e6056def4516dad14424845d5b1e9d20a8c51a120a1be39b986eff77c2f7a35145b9da27b1e63bd6d149bd8
data/LICENSE CHANGED
@@ -1,4 +1,4 @@
1
- Copyright (c) 2015 Javier Aranda <javier@aranda.io>
1
+ Copyright (c) 2018 Javier Aranda <javier.aranda.varo@gmail.com>
2
2
 
3
3
  Permission is hereby granted, free of charge, to any person obtaining a copy
4
4
  of this software and associated documentation files (the "Software"), to deal
data/README.md CHANGED
@@ -1 +1,81 @@
1
1
  # spinach-rerun-reporter
2
+
3
+ A reporter for [Spinach](https://github.com/codegram/spinach) that writes in a
4
+ file all failed scenarios in order to re-execute them.
5
+
6
+
7
+ ## Status
8
+
9
+ [![Gem Version](https://badge.fury.io/rb/spinach-rerun-reporter.svg)](https://badge.fury.io/rb/spinach-rerun-reporter)
10
+ [![Dependencies](https://gemnasium.com/badges/github.com/javierav/spinach-rerun-reporter.svg)](https://gemnasium.com/github.com/javierav/spinach-rerun-reporter)
11
+
12
+ > *Note*: You're reading the documentation for the next release, which should be 0.1.0
13
+
14
+
15
+ ## Installation
16
+
17
+ Add this line to your application's `Gemfile`:
18
+
19
+ ```
20
+ group :development, :test do
21
+ gem 'spinach-rerun-reporter'
22
+ end
23
+ ```
24
+
25
+ And then execute:
26
+
27
+ ```
28
+ $ bundle install
29
+ ```
30
+
31
+ ## Usage
32
+
33
+ ```
34
+ $ bundle exec spinach -r rerun
35
+ ```
36
+
37
+ When a scenario fails, the reporter writes the feature file and line in the file
38
+ specified in `SPINACH_RERUN_FILE` environment variable which defaults to
39
+ `tmp/spinach-rerun.txt` if not exists.
40
+
41
+ ### How to rerun
42
+
43
+ In order to rerun the failing scenarios you can use [this](examples/rerun.sh)
44
+ script.
45
+
46
+ ### Rails
47
+
48
+ If Rails is present, this gem adds a Rake task to your project that automatize
49
+ the rerun process.
50
+
51
+ ```
52
+ $ rake spinach:rerun
53
+ ```
54
+
55
+ You can use the following environment variables to configure it:
56
+
57
+ | Variable | Description | Default |
58
+ | --- | --- | --- |
59
+ | SPINACH_RERUN_TAGS | Specify tags for Spinach | nil |
60
+ | SPINACH_RERUN_FILE | Specify the rerun file | tmp/spinach-rerun.txt |
61
+ | SPINACH_RERUN_RETRY_COUNT | Specify the number of retry attemps | 3 |
62
+ | SPINACH_RERUN_PREPEND_CMD | Specify a prefix for run Spinach command | nil |
63
+
64
+
65
+ ## Contributing
66
+
67
+ 1. Fork it ( https://github.com/javierav/spinach-rerun-reporter/fork )
68
+ 2. Create your feature branch (`git checkout -b my-new-feature`)
69
+ 3. Commit your changes (`git commit -am 'Add some feature'`)
70
+ 4. Push to the branch (`git push origin my-new-feature`)
71
+ 5. Create a new Pull Request
72
+
73
+
74
+ ## Versioning
75
+
76
+ **spinach-rerun-reporter** uses [Semantic Versioning 2.0.0](http://semver.org)
77
+
78
+
79
+ ## License
80
+
81
+ Copyright (c) 2018 Javier Aranda - Released under [MIT](LICENSE) license
@@ -1 +1,3 @@
1
- require_relative 'spinach/reporter/rerun'
1
+ require 'spinach-rerun-reporter/version'
2
+ require 'spinach/reporter/rerun' if defined?(Spinach)
3
+ require 'spinach-rerun-reporter/rails' if defined?(Rails)
@@ -0,0 +1,7 @@
1
+ module SpinachRerunReporter
2
+ class Rails < ::Rails::Railtie
3
+ rake_tasks do
4
+ load File.expand_path('../../../tasks/spinach_rerun.rake', __FILE__)
5
+ end
6
+ end
7
+ end
@@ -0,0 +1,18 @@
1
+ module SpinachRerunReporter
2
+ module VERSION
3
+ MAJOR = 1
4
+ MINOR = 0
5
+ TINY = 0
6
+ PRE = nil
7
+
8
+ STRING = [MAJOR, MINOR, TINY, PRE].compact.join('.')
9
+ end
10
+
11
+ def self.version
12
+ VERSION::STRING
13
+ end
14
+
15
+ def self.gem_version
16
+ Gem::Version.new VERSION::STRING
17
+ end
18
+ end
@@ -5,10 +5,10 @@ module Spinach
5
5
  super(*args)
6
6
 
7
7
  # reset rerun.txt file
8
- File.delete('tmp/spinach-rerun.txt') if File.file?('tmp/spinach-rerun.txt')
8
+ File.delete(rerun_file) if File.file?(rerun_file)
9
9
 
10
10
  # create tmp folder if not exists
11
- Dir.mkdir('tmp', 0755) unless Dir.exist?('tmp')
11
+ Dir.mkdir('tmp', 0o755) unless Dir.exist?('tmp')
12
12
 
13
13
  # rerun list of failing scenarios
14
14
  @rerun = []
@@ -18,21 +18,27 @@ module Spinach
18
18
  super success
19
19
 
20
20
  # save rerun scenarios in a file
21
- File.open('tmp/spinach-rerun.txt', 'w') { |f| f.write @rerun.join("\n") } unless success
21
+ File.open(rerun_file, 'w') { |f| f.write @rerun.join("\n") } unless success
22
22
  end
23
23
 
24
- def on_failed_step(step, failure, step_location, step_definitions = nil)
24
+ def on_failed_step(step, failure, step_location, step_definitions=nil)
25
25
  super step, failure, step_location, step_definitions
26
26
 
27
27
  # save feature file and scenario line
28
- @rerun << "#{current_feature.filename}:#{current_scenario.line}"
28
+ @rerun << "#{current_feature.filename}:#{current_scenario.lines[0]}"
29
29
  end
30
30
 
31
- def on_error_step(step, failure, step_location, step_definitions = nil)
31
+ def on_error_step(step, failure, step_location, step_definitions=nil)
32
32
  super step, failure, step_location, step_definitions
33
33
 
34
34
  # save feature file and scenario line
35
- @rerun << "#{current_feature.filename}:#{current_scenario.line}"
35
+ @rerun << "#{current_feature.filename}:#{current_scenario.lines[0]}"
36
+ end
37
+
38
+ private
39
+
40
+ def rerun_file
41
+ ENV['SPINACH_RERUN_FILE'] || 'tmp/spinach-rerun.txt'
36
42
  end
37
43
  end
38
44
  end
@@ -0,0 +1,30 @@
1
+ require 'date'
2
+ require_relative 'lib/spinach-rerun-reporter/version'
3
+
4
+ Gem::Specification.new do |s|
5
+ #
6
+ ## INFORMATION
7
+ #
8
+ s.name = 'spinach-rerun-reporter'
9
+ s.version = SpinachRerunReporter.version
10
+ s.summary = 'spinach rerun reporter'
11
+ s.description = nil
12
+ s.author = %w[Javier Aranda]
13
+ s.email = %w[javier.aranda.varo@gmail.com]
14
+ s.license = 'MIT'
15
+ s.date = Date.today.strftime('%Y-%m-%d')
16
+ s.homepage = 'https://github.com/javierav/spinach-rerun-reporter'
17
+
18
+ #
19
+ ## GEM
20
+ #
21
+ s.require_paths = %w[lib]
22
+ s.files = `git ls-files -z -- lib/* LICENSE README.md spinach-rerun-reporter.gemspec`.split("\x0")
23
+ s.extra_rdoc_files = %w[README.md LICENSE]
24
+ s.required_ruby_version = '> 2.0'
25
+
26
+ #
27
+ ## DEPENDENCIES
28
+ #
29
+ s.add_dependency 'spinach', '~> 0.10', '> 0.10'
30
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: spinach-rerun-reporter
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 1.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Javier
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2015-07-28 00:00:00.000000000 Z
12
+ date: 2018-09-28 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: spinach
@@ -17,17 +17,23 @@ dependencies:
17
17
  requirements:
18
18
  - - "~>"
19
19
  - !ruby/object:Gem::Version
20
- version: '0.8'
20
+ version: '0.10'
21
+ - - ">"
22
+ - !ruby/object:Gem::Version
23
+ version: '0.10'
21
24
  type: :runtime
22
25
  prerelease: false
23
26
  version_requirements: !ruby/object:Gem::Requirement
24
27
  requirements:
25
28
  - - "~>"
26
29
  - !ruby/object:Gem::Version
27
- version: '0.8'
30
+ version: '0.10'
31
+ - - ">"
32
+ - !ruby/object:Gem::Version
33
+ version: '0.10'
28
34
  description: ''
29
35
  email:
30
- - javier@aranda.io
36
+ - javier.aranda.varo@gmail.com
31
37
  executables: []
32
38
  extensions: []
33
39
  extra_rdoc_files:
@@ -37,8 +43,11 @@ files:
37
43
  - LICENSE
38
44
  - README.md
39
45
  - lib/spinach-rerun-reporter.rb
46
+ - lib/spinach-rerun-reporter/rails.rb
47
+ - lib/spinach-rerun-reporter/version.rb
40
48
  - lib/spinach/reporter/rerun.rb
41
- homepage: https://github.com/arandaio/spinach-rerun-reporter
49
+ - spinach-rerun-reporter.gemspec
50
+ homepage: https://github.com/javierav/spinach-rerun-reporter
42
51
  licenses:
43
52
  - MIT
44
53
  metadata: {}
@@ -48,7 +57,7 @@ require_paths:
48
57
  - lib
49
58
  required_ruby_version: !ruby/object:Gem::Requirement
50
59
  requirements:
51
- - - "~>"
60
+ - - ">"
52
61
  - !ruby/object:Gem::Version
53
62
  version: '2.0'
54
63
  required_rubygems_version: !ruby/object:Gem::Requirement
@@ -58,7 +67,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
58
67
  version: '0'
59
68
  requirements: []
60
69
  rubyforge_project:
61
- rubygems_version: 2.4.6
70
+ rubygems_version: 2.4.5
62
71
  signing_key:
63
72
  specification_version: 4
64
73
  summary: spinach rerun reporter