rutabaga 2.1.2 → 2.1.3

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: e658e55a62c03d471c468d74e81ae7d7a75d5ae9
4
- data.tar.gz: d2c8805e066a8b0397c631606b79ad3d2f897306
3
+ metadata.gz: 459bc0f70e553e4339d7c2e7d568ff5cd855d6a2
4
+ data.tar.gz: 46b441f305afecaa2cdca6fbb41969ee13a6a594
5
5
  SHA512:
6
- metadata.gz: 891c7e1075f41e6d476beade6e6bdc709f0c43d878091e93faa494da0fba335ab17426b97471d7a8ca947c82690c67cc9765aadd377132cd0f379bbcb64b9d33
7
- data.tar.gz: 50e16e48ff71758f7b2fa0e36920ea08f6fb6cf3f442e44c3f6c009e7e833da126e657bcbeedb2b3456bf1b6cd1b252476025a1f1f3d260f04236bd14a9b53ad
6
+ metadata.gz: 03c353f0db97038dff8326aa044abd7666ff871a93d7b5360ebe1c3411f33cdbafe35b01f35ded61afa79a3d1a1eb19ae63c4f2aea1a0d23573b86bfac5b6ae9
7
+ data.tar.gz: d6980051aa0b16cf1865e9482f04d0fe31cf7a954a5462803c997729647f90a252e80b1217783a62b016369a0fda3fe36f5535d61798c5000af4a825841fec04
data/CHANGELOG.md CHANGED
@@ -1,5 +1,15 @@
1
1
  # Changes
2
2
 
3
+ ## Version 2.1.3
4
+
5
+ - Fixes ability for parallel_tests to handle turnip output, even when rutabaga is used. This has been broken since version 2.0
6
+
7
+ ## Version 2.1.0
8
+
9
+ - **No Turnip Mode**: Turnip support can now be disabled by including `rutabaga/no_turnip` for example
10
+ by calling `rspec -r rutabaga/no_turnip`
11
+ - When requesting features outside of the turnip directory `spec/features` a warning is issued
12
+
3
13
  ## Version 2.0.0
4
14
 
5
15
  - Features should now be called directly in the describe block rather than inside an `it` block. This allows specific scenarios to be run without having to run the entire feature.
data/README.md CHANGED
@@ -173,6 +173,24 @@ The goal is to test just the business rule in Rutabaga, and not the login, the h
173
173
 
174
174
  Use `gem-release` to maintain versions https://github.com/svenfuchs/gem-release.
175
175
 
176
+ To update the minor version (e.g. 0.0.1 to 0.0.2), after merging the PR to `master` run:
177
+
178
+ ```
179
+ gem bump --tag --release
180
+ ```
181
+
182
+ if instead you want to bump the minor version (e.g. 0.0.1 to 0.1.0):
183
+
184
+ ```
185
+ gem bump --version minor --tag --release
186
+ ```
187
+
188
+ or major version (e.g. 0.0.1 to 1.0.0):
189
+
190
+ ```
191
+ gem bump --version major --tag --release
192
+ ```
193
+
176
194
  ## Testing alternate versions
177
195
 
178
196
  Put the following (example in a `Gemfile_for_xxx`) to test other versions of gems.
@@ -0,0 +1,33 @@
1
+ # This file needs to be in this folder structure otherwise rspec
2
+ # will not filter it out of the caller chain, and therefore report
3
+ # incorrect file locations for example groups. This especially
4
+ # affects turnip mode.
5
+
6
+ # Monkey patch rspec to block capybara from using feature
7
+ class RSpec::Core::Configuration
8
+ alias_method :orig_alias_example_group_to, :alias_example_group_to
9
+
10
+ def alias_example_group_to(new_name, *args)
11
+ return if [:feature, :xfeature, :ffeature].include?(new_name)
12
+ orig_alias_example_group_to(new_name, *args)
13
+ end
14
+ end
15
+
16
+ # Monkey patch RSpec to add the feature method in example groups
17
+ class RSpec::Core::ExampleGroup
18
+ class << self
19
+ alias_method :orig_subclass, :subclass
20
+
21
+ def subclass(parent, description, args, &example_group_block)
22
+ self.orig_subclass(parent, description, args, &example_group_block).tap do |describe|
23
+
24
+ if args.any? { |arg| arg.kind_of?(Hash) && arg[:rutabaga] }
25
+ Rutabaga::ExampleGroup::Feature.feature(describe, description, args)
26
+ end
27
+
28
+ end
29
+ end
30
+ end
31
+
32
+ define_example_group_method :feature, :rutabaga => true
33
+ end
data/lib/rutabaga.rb CHANGED
@@ -2,5 +2,6 @@ require 'rutabaga/version'
2
2
  require 'turnip'
3
3
  require 'rutabaga/feature'
4
4
  require 'rutabaga/example_group/feature'
5
+ require 'rspec/core/example_group_patch'
5
6
  require 'rutabaga/util'
6
7
  require 'rutabaga/turnip' # is disabled by 'rutabaga/no_turnip'
@@ -1,35 +1,6 @@
1
1
  require 'turnip/rspec'
2
2
  require 'rspec'
3
3
 
4
- # Monkey patch rspec to block capybara from using feature
5
- class RSpec::Core::Configuration
6
- alias_method :orig_alias_example_group_to, :alias_example_group_to
7
-
8
- def alias_example_group_to(new_name, *args)
9
- return if [:feature, :xfeature, :ffeature].include?(new_name)
10
- orig_alias_example_group_to(new_name, *args)
11
- end
12
- end
13
-
14
- # Monkey patch RSpec to add the feature method in example groups
15
- class RSpec::Core::ExampleGroup
16
- class << self
17
- alias_method :orig_subclass, :subclass
18
-
19
- def subclass(parent, description, args, &example_group_block)
20
- self.orig_subclass(parent, description, args, &example_group_block).tap do |describe|
21
-
22
- if args.any? { |arg| arg.kind_of?(Hash) && arg[:rutabaga] }
23
- Rutabaga::ExampleGroup::Feature.feature(describe, description, args)
24
- end
25
-
26
- end
27
- end
28
- end
29
-
30
- define_example_group_method :feature, :rutabaga => true
31
- end
32
-
33
4
  module Rutabaga
34
5
  module ExampleGroup
35
6
  module Feature
@@ -1,3 +1,3 @@
1
1
  module Rutabaga
2
- VERSION = '2.1.2'
2
+ VERSION = '2.1.3'
3
3
  end
@@ -0,0 +1,15 @@
1
+ require 'spec_helper'
2
+
3
+ describe 'formatter', :type => :integration do
4
+ before(:all) do
5
+ @result = %x(rspec -r rutabaga -r rspec_formatter/formatter.rb --format RspecFormatter::Formatter spec/features/fixture.feature examples/test_spec.rb 2>&1)
6
+ end
7
+
8
+ it "has the feature location" do
9
+ expect(@result).to include("rspec_core_formatter:file_path: ./spec/features/fixture.feature")
10
+ end
11
+
12
+ it "has the rutabaga test location" do
13
+ expect(@result).to include("rspec_core_formatter:file_path: ./examples/test_spec.rb")
14
+ end
15
+ end
@@ -0,0 +1,20 @@
1
+ module RspecFormatter
2
+ class Formatter
3
+ RSpec::Core::Formatters.register self, :example_group_started, :example_group_finished
4
+
5
+ def initialize(output)
6
+ @group_nesting = 0
7
+ end
8
+
9
+ def example_group_started(example_group)
10
+ @group_nesting += 1
11
+ end
12
+
13
+ def example_group_finished(notification)
14
+ @group_nesting -= 1
15
+ if @group_nesting == 0
16
+ puts "rspec_core_formatter:file_path: #{notification.group.file_path}"
17
+ end
18
+ end
19
+ end
20
+ end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rutabaga
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.1.2
4
+ version: 2.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Lukas Oberhuber
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-06-09 00:00:00.000000000 Z
11
+ date: 2016-06-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: turnip
@@ -96,6 +96,7 @@ files:
96
96
  - examples/test_feature_example_group.feature
97
97
  - examples/test_feature_example_group_spec.rb
98
98
  - examples/test_spec.rb
99
+ - lib/rspec/core/example_group_patch.rb
99
100
  - lib/rutabaga.rb
100
101
  - lib/rutabaga/example_group/feature.rb
101
102
  - lib/rutabaga/feature.rb
@@ -107,7 +108,9 @@ files:
107
108
  - rutabaga.gemspec
108
109
  - spec/feature_spec.rb
109
110
  - spec/features/fixture.feature
111
+ - spec/formatter_spec.rb
110
112
  - spec/no_turnip_spec.rb
113
+ - spec/rspec_formatter/formatter.rb
111
114
  - spec/rutabaga/util_spec.rb
112
115
  - spec/spec_helper.rb
113
116
  homepage: https://github.com/simplybusiness/rutabaga
@@ -138,7 +141,9 @@ summary: Calling Turnip feature files from RSpec, which allows encapsulating a f
138
141
  test_files:
139
142
  - spec/feature_spec.rb
140
143
  - spec/features/fixture.feature
144
+ - spec/formatter_spec.rb
141
145
  - spec/no_turnip_spec.rb
146
+ - spec/rspec_formatter/formatter.rb
142
147
  - spec/rutabaga/util_spec.rb
143
148
  - spec/spec_helper.rb
144
149
  has_rdoc: