rutabaga 3.0.1 → 3.1.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 +4 -4
- data/.github/workflows/ci.yml +36 -0
- data/.github/workflows/codeql-analysis.yml +70 -0
- data/.github/workflows/gempush.yml +32 -0
- data/.github/workflows/project-board.yml +17 -0
- data/.github/workflows/rubocop-analysis.yml +22 -0
- data/CHANGELOG.md +5 -0
- data/CODEOWNERS +4 -0
- data/Gemfile +4 -7
- data/README.md +5 -27
- data/Rakefile +3 -1
- data/catalog-info.yaml +8 -0
- data/examples/compatibility/compatibility_spec.rb +5 -3
- data/examples/pattern/test_pattern_spec.rb +4 -2
- data/examples/spec_helper.rb +3 -1
- data/examples/test_feature_example_group_spec.rb +31 -31
- data/examples/test_spec.rb +6 -5
- data/lib/rspec/core/example_group_patch.rb +12 -7
- data/lib/rutabaga/example_group/feature.rb +3 -1
- data/lib/rutabaga/no_turnip.rb +4 -2
- data/lib/rutabaga/turnip.rb +7 -5
- data/lib/rutabaga/util.rb +11 -7
- data/lib/rutabaga/version.rb +3 -1
- data/lib/rutabaga.rb +2 -0
- data/rutabaga.gemspec +7 -6
- data/spec/feature_spec.rb +18 -16
- data/spec/formatter_spec.rb +8 -6
- data/spec/no_turnip_spec.rb +27 -25
- data/spec/rspec_formatter/formatter.rb +4 -2
- data/spec/rutabaga/util_spec.rb +66 -54
- data/spec/spec_helper.rb +3 -1
- metadata +27 -28
- data/.travis.yml +0 -17
data/lib/rutabaga/util.rb
CHANGED
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
# Utils and monkey patches for both versions of feature
|
2
4
|
|
3
5
|
# Monkey patch for Turnip to not have to copy loads of code
|
@@ -24,16 +26,18 @@ module Rutabaga
|
|
24
26
|
tried = []
|
25
27
|
|
26
28
|
if description =~ /.*\.(feature|rutabaga)\Z/
|
27
|
-
return description if File.
|
29
|
+
return description if File.exist?(description)
|
30
|
+
|
28
31
|
tried << description
|
29
32
|
|
30
33
|
candidate = File.join(extract_directory, description)
|
31
|
-
return candidate if File.
|
34
|
+
return candidate if File.exist?(candidate)
|
35
|
+
|
32
36
|
tried << candidate
|
33
37
|
else
|
34
38
|
feature_files = extract_features
|
35
39
|
feature_files.each do |feature_file|
|
36
|
-
return feature_file if File.
|
40
|
+
return feature_file if File.exist?(feature_file)
|
37
41
|
end
|
38
42
|
tried += feature_files
|
39
43
|
end
|
@@ -57,14 +61,14 @@ module Rutabaga
|
|
57
61
|
def extract_directory
|
58
62
|
caller(0).find do |call|
|
59
63
|
call =~ /_spec.rb:/
|
60
|
-
end.gsub(
|
64
|
+
end.gsub(%r{/[^/]+_spec.rb:.*\Z}, '')
|
61
65
|
end
|
62
66
|
|
63
67
|
def extract_features
|
64
68
|
base = caller(0).find do |call|
|
65
69
|
call =~ /_spec.rb:/
|
66
70
|
end.gsub(/_spec.rb:.*\Z/, '')
|
67
|
-
[base+'.feature', base+'.rutabaga']
|
71
|
+
[base + '.feature', base + '.rutabaga']
|
68
72
|
end
|
69
73
|
end
|
70
74
|
end
|
@@ -73,8 +77,8 @@ end
|
|
73
77
|
::RSpec.configure do |c|
|
74
78
|
# Blow away turnip's pattern, and focus just on features directory
|
75
79
|
if defined?(Rutabaga::NO_TURNIP)
|
76
|
-
c.pattern.gsub!(
|
80
|
+
c.pattern.gsub!(',**/*.feature', '')
|
77
81
|
else
|
78
|
-
c.pattern.gsub!(
|
82
|
+
c.pattern.gsub!(',**/*.feature', ',features/**/*.feature')
|
79
83
|
end
|
80
84
|
end
|
data/lib/rutabaga/version.rb
CHANGED
data/lib/rutabaga.rb
CHANGED
data/rutabaga.gemspec
CHANGED
@@ -1,14 +1,15 @@
|
|
1
|
-
#
|
2
|
-
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require File.expand_path('lib/rutabaga/version', __dir__)
|
3
4
|
|
4
5
|
Gem::Specification.new do |gem|
|
5
6
|
gem.authors = ['Lukas Oberhuber']
|
6
7
|
gem.email = ['lukas.oberhuber@simplybusiness.co.uk']
|
7
|
-
gem.description =
|
8
|
-
gem.summary =
|
8
|
+
gem.description = 'Allows using feature from within RSpec and is built on top of Turnip'
|
9
|
+
gem.summary = 'Calling Turnip feature files from RSpec, which allows encapsulating a feature inside a describe block'
|
9
10
|
gem.homepage = 'https://github.com/simplybusiness/rutabaga'
|
10
11
|
|
11
|
-
gem.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
|
12
|
+
gem.executables = `git ls-files -- bin/*`.split("\n").map { |f| File.basename(f) }
|
12
13
|
gem.files = `git ls-files`.split("\n")
|
13
14
|
gem.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
|
14
15
|
gem.name = 'rutabaga'
|
@@ -16,8 +17,8 @@ Gem::Specification.new do |gem|
|
|
16
17
|
gem.version = Rutabaga::VERSION
|
17
18
|
gem.license = 'MIT'
|
18
19
|
|
19
|
-
gem.add_runtime_dependency 'turnip', ['>= 3.1.0', '< 5.0']
|
20
20
|
gem.add_runtime_dependency 'rspec', ['~> 3.0']
|
21
|
+
gem.add_runtime_dependency 'turnip', ['>= 3.1.0', '< 4.4']
|
21
22
|
|
22
23
|
gem.add_development_dependency 'capybara'
|
23
24
|
gem.add_development_dependency 'pry', '~> 0'
|
data/spec/feature_spec.rb
CHANGED
@@ -1,39 +1,41 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
require 'spec_helper'
|
2
4
|
|
3
|
-
describe 'integration', :
|
5
|
+
describe 'integration', type: :integration do
|
4
6
|
describe 'functionality' do
|
5
7
|
before(:all) do
|
6
|
-
@result =
|
8
|
+
@result = `rspec -r rutabaga -fd examples/*_spec.rb 2>&1`
|
7
9
|
end
|
8
10
|
|
9
|
-
it
|
11
|
+
it 'shows the correct description' do
|
10
12
|
expect(@result).to include('ensures the feature is called')
|
11
13
|
expect(@result).to include('that 2 + 2 is calculated')
|
12
14
|
expect(@result).to include('my result is 4')
|
13
15
|
end
|
14
16
|
|
15
|
-
it
|
17
|
+
it 'executes features as an argument' do
|
16
18
|
expect(@result).to include('test feature argument')
|
17
19
|
end
|
18
20
|
|
19
|
-
it
|
21
|
+
it 'executes features as blocks/example groups' do
|
20
22
|
expect(@result).to include('feature block')
|
21
23
|
end
|
22
24
|
|
23
|
-
it
|
25
|
+
it 'executes features as blocks inside example groups' do
|
24
26
|
expect(@result).to include('feature block inside a describe block')
|
25
27
|
end
|
26
28
|
|
27
|
-
it
|
29
|
+
it 'should not show any pending steps' do
|
28
30
|
expect(@result).not_to include('PENDING')
|
29
31
|
expect(@result).not_to include('No such step')
|
30
32
|
end
|
31
33
|
|
32
|
-
it
|
34
|
+
it 'prints out failures and successes' do
|
33
35
|
expect(@result).to include('18 examples, 4 failures')
|
34
36
|
end
|
35
37
|
|
36
|
-
it
|
38
|
+
it 'should find features relative to the root' do
|
37
39
|
expect(@result).not_to include('Feature file not found')
|
38
40
|
end
|
39
41
|
|
@@ -42,26 +44,26 @@ describe 'integration', :type => :integration do
|
|
42
44
|
expect(@result).to include('my result is 8')
|
43
45
|
end
|
44
46
|
|
45
|
-
it
|
47
|
+
it 'should scope steps to describe blocks' do
|
46
48
|
expect(@result).not_to include('Turnip::Ambiguous')
|
47
49
|
end
|
48
50
|
|
49
|
-
it
|
50
|
-
expect(@result).to
|
51
|
+
it 'should provide failure messages that allow a specific scenario to be run' do
|
52
|
+
expect(@result).to match(%r{rspec '{0,1}./examples/test_feature_example_group_spec.rb\[1:1:1:4:1\]'{0,1}})
|
51
53
|
end
|
52
54
|
end
|
53
55
|
|
54
56
|
describe 'compatibility' do
|
55
57
|
before(:all) do
|
56
|
-
@result =
|
58
|
+
@result = `rspec -r rutabaga -fd examples/compatibility/*_spec.rb 2>&1`
|
57
59
|
end
|
58
60
|
|
59
|
-
it
|
61
|
+
it 'passes all tests' do
|
60
62
|
expect(@result).to include('1 example, 0 failures')
|
61
63
|
end
|
62
64
|
|
63
|
-
it
|
64
|
-
expect(@result).to include(
|
65
|
+
it 'runs feature blocks even if capybara/rspec is installed' do
|
66
|
+
expect(@result).to include('capaybara rails does not overwrite the feature command')
|
65
67
|
end
|
66
68
|
end
|
67
69
|
end
|
data/spec/formatter_spec.rb
CHANGED
@@ -1,15 +1,17 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
require 'spec_helper'
|
2
4
|
|
3
|
-
describe 'formatter', :
|
5
|
+
describe 'formatter', type: :integration do
|
4
6
|
before(:all) do
|
5
|
-
@result =
|
7
|
+
@result = `rspec -r rutabaga -r rspec_formatter/formatter.rb --format RspecFormatter::Formatter spec/features/fixture.feature examples/test_spec.rb 2>&1`
|
6
8
|
end
|
7
9
|
|
8
|
-
it
|
9
|
-
expect(@result).to include(
|
10
|
+
it 'has the feature location' do
|
11
|
+
expect(@result).to include('rspec_core_formatter:file_path: ./spec/features/fixture.feature')
|
10
12
|
end
|
11
13
|
|
12
|
-
it
|
13
|
-
expect(@result).to include(
|
14
|
+
it 'has the rutabaga test location' do
|
15
|
+
expect(@result).to include('rspec_core_formatter:file_path: ./examples/test_spec.rb')
|
14
16
|
end
|
15
17
|
end
|
data/spec/no_turnip_spec.rb
CHANGED
@@ -1,57 +1,59 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
require 'spec_helper'
|
2
4
|
|
3
|
-
describe 'no_turnip', :
|
5
|
+
describe 'no_turnip', type: :integration do
|
4
6
|
describe 'turnip disabled' do
|
5
7
|
before(:all) do
|
6
|
-
@result =
|
8
|
+
@result = `rspec -r rutabaga -r rutabaga/no_turnip examples/test.feature 2>&1`
|
7
9
|
end
|
8
10
|
|
9
|
-
it
|
10
|
-
expect(@result).to include(
|
11
|
-
expect(@result).to include(
|
11
|
+
it 'should raise an error when trying to call turnip features directly' do
|
12
|
+
expect(@result).to include('Calling features directly has been disabled by rutabaga')
|
13
|
+
expect(@result).to include('rutabaga/no_turnip')
|
12
14
|
end
|
13
15
|
|
14
|
-
it
|
15
|
-
result =
|
16
|
+
it 'has the correct file pattern' do
|
17
|
+
result = `rspec -r rutabaga/no_turnip -r rutabaga examples/pattern/test_pattern_spec.rb`
|
16
18
|
expect(result).to include("RSpec.configuration.pattern: **{,/*/**}/*_spec.rb\n")
|
17
|
-
result =
|
19
|
+
result = `rspec -r rutabaga -r rutabaga/no_turnip -r rutabaga examples/pattern/test_pattern_spec.rb`
|
18
20
|
expect(result).to include("RSpec.configuration.pattern: **{,/*/**}/*_spec.rb\n")
|
19
|
-
result =
|
21
|
+
result = `rspec -r rutabaga/no_turnip examples/pattern/test_pattern_spec.rb`
|
20
22
|
expect(result).to include("RSpec.configuration.pattern: **{,/*/**}/*_spec.rb\n")
|
21
23
|
end
|
22
24
|
end
|
23
25
|
|
24
26
|
describe 'turnip enabled' do
|
25
|
-
describe
|
26
|
-
it
|
27
|
-
@result =
|
28
|
-
expect(@result).to include(
|
27
|
+
describe 'in correct directory' do
|
28
|
+
it 'should be able to call features directly' do
|
29
|
+
@result = `rspec -r rutabaga/turnip spec/features/fixture.feature 2>&1`
|
30
|
+
expect(@result).to include('No such step')
|
29
31
|
end
|
30
32
|
|
31
|
-
it
|
32
|
-
@result =
|
33
|
-
expect(@result).to include(
|
33
|
+
it 'rutabaga turnip is the default' do
|
34
|
+
@result = `rspec -r rutabaga spec/features/fixture.feature 2>&1`
|
35
|
+
expect(@result).to include('No such step')
|
34
36
|
end
|
35
37
|
end
|
36
38
|
|
37
|
-
describe
|
39
|
+
describe 'outside of the correct directory' do
|
38
40
|
before(:all) do
|
39
|
-
@result =
|
41
|
+
@result = `rspec -r rutabaga examples/test.feature 2>&1`
|
40
42
|
end
|
41
43
|
|
42
|
-
it
|
43
|
-
expect(@result).to include(
|
44
|
+
it 'warns about the directory' do
|
45
|
+
expect(@result).to include('WARNING: Features can only be called from turnip enable directories')
|
44
46
|
end
|
45
47
|
end
|
46
48
|
|
47
|
-
it
|
48
|
-
result =
|
49
|
+
it 'has the correct file pattern' do
|
50
|
+
result = `rspec -r rutabaga examples/pattern/test_pattern_spec.rb`
|
49
51
|
expect(result).to include("RSpec.configuration.pattern: **{,/*/**}/*_spec.rb,features/**/*.feature\n")
|
50
|
-
result =
|
52
|
+
result = `rspec -r rutabaga/turnip -r rutabaga examples/pattern/test_pattern_spec.rb`
|
51
53
|
expect(result).to include("RSpec.configuration.pattern: **{,/*/**}/*_spec.rb,features/**/*.feature\n")
|
52
|
-
result =
|
54
|
+
result = `rspec -r rutabaga -r rutabaga/turnip -r rutabaga examples/pattern/test_pattern_spec.rb`
|
53
55
|
expect(result).to include("RSpec.configuration.pattern: **{,/*/**}/*_spec.rb,features/**/*.feature\n")
|
54
|
-
result =
|
56
|
+
result = `rspec -r rutabaga/turnip examples/pattern/test_pattern_spec.rb`
|
55
57
|
expect(result).to include("RSpec.configuration.pattern: **{,/*/**}/*_spec.rb,features/**/*.feature\n")
|
56
58
|
end
|
57
59
|
end
|
@@ -1,12 +1,14 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
module RspecFormatter
|
2
4
|
class Formatter
|
3
5
|
RSpec::Core::Formatters.register self, :example_group_started, :example_group_finished
|
4
6
|
|
5
|
-
def initialize(
|
7
|
+
def initialize(_output)
|
6
8
|
@group_nesting = 0
|
7
9
|
end
|
8
10
|
|
9
|
-
def example_group_started(
|
11
|
+
def example_group_started(_example_group)
|
10
12
|
@group_nesting += 1
|
11
13
|
end
|
12
14
|
|
data/spec/rutabaga/util_spec.rb
CHANGED
@@ -1,129 +1,141 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
require 'spec_helper'
|
2
4
|
require 'rutabaga'
|
3
5
|
|
4
6
|
describe Rutabaga::Util do
|
5
|
-
describe
|
6
|
-
it
|
7
|
-
expect(subject.class.send(:extract_directory)).to match(
|
7
|
+
describe 'location of test from stack track' do
|
8
|
+
it 'finds the directory' do
|
9
|
+
expect(subject.class.send(:extract_directory)).to match(%r{/rutabaga/spec/rutabaga\Z})
|
8
10
|
end
|
9
11
|
|
10
|
-
it
|
12
|
+
it 'finds the feature' do
|
11
13
|
features = subject.class.send(:extract_features)
|
12
|
-
expect(features[0]).to match(
|
13
|
-
expect(features[1]).to match(
|
14
|
+
expect(features[0]).to match(%r{/rutabaga/spec/rutabaga/util\.feature\Z})
|
15
|
+
expect(features[1]).to match(%r{/rutabaga/spec/rutabaga/util\.rutabaga\Z})
|
14
16
|
end
|
15
17
|
end
|
16
18
|
|
17
|
-
describe
|
19
|
+
describe '.find_feature' do
|
18
20
|
let(:subject) { Rutabaga::Util.find_feature(@description) }
|
19
21
|
before do
|
20
|
-
allow(File).to receive(:
|
21
|
-
allow(File).to receive(:
|
22
|
-
allow(File).to receive(:
|
22
|
+
allow(File).to receive(:exist?).with('spec/rutabaga/existing.feature').and_return(true)
|
23
|
+
allow(File).to receive(:exist?).with('spec/rutabaga/missing.feature').and_return(false)
|
24
|
+
allow(File).to receive(:exist?).with(nil).and_return(false)
|
23
25
|
end
|
24
26
|
|
25
|
-
it
|
27
|
+
it 'returns the file if it exists' do
|
26
28
|
@description = 'spec/rutabaga/existing.feature'
|
27
29
|
expect(subject).to eq('spec/rutabaga/existing.feature')
|
28
30
|
end
|
29
31
|
|
30
32
|
describe "looks for the feature in the spec's directory" do
|
31
33
|
before do
|
32
|
-
allow(File).to receive(:
|
34
|
+
allow(File).to receive(:exist?).with('different.feature').and_return(false)
|
33
35
|
end
|
34
36
|
|
35
|
-
it
|
37
|
+
it 'looks directly in the directory' do
|
36
38
|
@description = 'different.feature'
|
37
|
-
expect(File).to receive(:
|
39
|
+
expect(File).to receive(:exist?)
|
40
|
+
.with(%r{spec/rutabaga/different\.feature\Z})
|
41
|
+
.and_return(true)
|
38
42
|
|
39
|
-
expect(subject).to match(/
|
43
|
+
expect(subject).to match(%r{spec/rutabaga/different\.feature\Z})
|
40
44
|
end
|
41
45
|
|
42
|
-
it
|
43
|
-
allow(File).to receive(:
|
46
|
+
it 'allows sub-directories' do
|
47
|
+
allow(File).to receive(:exist?).with('subdirectory/different.feature')
|
48
|
+
.and_return(false)
|
44
49
|
|
45
50
|
@description = 'subdirectory/different.feature'
|
46
|
-
expect(File).to receive(:
|
51
|
+
expect(File).to receive(:exist?)
|
52
|
+
.with(%r{spec/rutabaga/subdirectory/different\.feature\Z})
|
53
|
+
.and_return(true)
|
47
54
|
|
48
|
-
expect(subject).to match(/
|
55
|
+
expect(subject).to match(%r{spec/rutabaga/subdirectory/different\.feature\Z})
|
49
56
|
end
|
50
57
|
end
|
51
58
|
|
52
|
-
describe
|
53
|
-
it
|
59
|
+
describe 'figures out the feature name from the spec name' do
|
60
|
+
it 'description is nil' do
|
54
61
|
@description = nil
|
55
|
-
allow(File).to receive(:
|
56
|
-
|
62
|
+
allow(File).to receive(:exist?).with(%r{spec/rutabaga/util\.feature\Z})
|
63
|
+
.and_return(true)
|
64
|
+
expect(subject).to match(%r{spec/rutabaga/util\.feature\Z})
|
57
65
|
end
|
58
66
|
|
59
|
-
it
|
67
|
+
it 'description does not match a feature file' do
|
60
68
|
@description = 'this is not a feature file'
|
61
|
-
allow(File).to receive(:
|
69
|
+
allow(File).to receive(:exist?).with(/this is not a feature file/)
|
70
|
+
.and_return(false)
|
62
71
|
|
63
|
-
allow(File).to receive(:
|
64
|
-
|
72
|
+
allow(File).to receive(:exist?).with(%r{spec/rutabaga/util\.feature\Z})
|
73
|
+
.and_return(true)
|
74
|
+
expect(subject).to match(%r{spec/rutabaga/util\.feature\Z})
|
65
75
|
end
|
66
76
|
|
67
|
-
it
|
77
|
+
it 'description does not match a feature file' do
|
68
78
|
@description = 'this is not a feature file'
|
69
|
-
allow(File).to receive(:
|
79
|
+
allow(File).to receive(:exist?).with(/this is not a feature file/).and_return(false)
|
80
|
+
|
81
|
+
allow(File).to receive(:exist?).with(%r{spec/rutabaga/util\.feature\Z})
|
82
|
+
.and_return(false)
|
83
|
+
allow(File).to receive(:exist?).with(%r{spec/rutabaga/util\.rutabaga\Z})
|
84
|
+
.and_return(true)
|
70
85
|
|
71
|
-
|
72
|
-
allow(File).to receive(:exists?).with(/spec\/rutabaga\/util\.rutabaga\Z/).and_return(true)
|
73
|
-
expect(subject).to match(/spec\/rutabaga\/util\.rutabaga\Z/)
|
86
|
+
expect(subject).to match(%r{spec/rutabaga/util\.rutabaga\Z})
|
74
87
|
end
|
75
88
|
|
76
|
-
it
|
89
|
+
it 'handles paths with spaces' do
|
77
90
|
@description = '/User/person/Internet plugins/feature.feature'
|
78
|
-
allow(File).to receive(:
|
91
|
+
allow(File).to receive(:exist?).with(@description).and_return(true)
|
79
92
|
|
80
93
|
expect(subject).to eq(@description)
|
81
94
|
end
|
82
95
|
|
83
|
-
it
|
84
|
-
@description =
|
85
|
-
allow(File).to receive(:
|
96
|
+
it 'allows the .feature extension' do
|
97
|
+
@description = 'example.feature'
|
98
|
+
allow(File).to receive(:exist?).with(@description).and_return(true)
|
86
99
|
|
87
100
|
expect(subject).to include(@description)
|
88
101
|
end
|
89
102
|
|
90
|
-
it
|
91
|
-
@description =
|
92
|
-
allow(File).to receive(:
|
103
|
+
it 'allows the .rutabaga extension' do
|
104
|
+
@description = 'example.rutabaga'
|
105
|
+
allow(File).to receive(:exist?).with(@description).and_return(true)
|
93
106
|
|
94
107
|
expect(subject).to include(@description)
|
95
108
|
end
|
96
|
-
|
97
109
|
end
|
98
110
|
|
99
|
-
describe
|
111
|
+
describe 'raises an error if the feature cannot be found' do
|
100
112
|
before do
|
101
|
-
allow(File).to receive(:
|
113
|
+
allow(File).to receive(:exist?).and_return(false)
|
102
114
|
end
|
103
115
|
|
104
|
-
it
|
116
|
+
it 'has a nil description' do
|
105
117
|
@description = nil
|
106
118
|
|
107
|
-
expect{subject}.to raise_error(
|
119
|
+
expect { subject }.to raise_error(%r{Feature file not found\. Tried: .*/spec/rutabaga/util\.feature})
|
108
120
|
end
|
109
121
|
|
110
|
-
it
|
111
|
-
@description =
|
122
|
+
it 'has a sentance description' do
|
123
|
+
@description = 'my life as a dog'
|
112
124
|
|
113
|
-
expect{subject}.to raise_error(
|
125
|
+
expect { subject }.to raise_error(%r{Feature file not found\. Tried: .*/spec/rutabaga/util\.feature})
|
114
126
|
end
|
115
127
|
|
116
128
|
it "has a filename description but the file doesn't exist" do
|
117
|
-
@description =
|
129
|
+
@description = 'example.feature'
|
118
130
|
|
119
|
-
expect{subject}.to raise_error(/Feature file not found\. Tried: example\.feature, .*example\.feature/)
|
131
|
+
expect { subject }.to raise_error(/Feature file not found\. Tried: example\.feature, .*example\.feature/)
|
120
132
|
end
|
121
133
|
|
122
|
-
it
|
123
|
-
@description =
|
124
|
-
allow(File).to receive(:
|
134
|
+
it 'raises an error if the filename does not end in feature' do
|
135
|
+
@description = 'example.other'
|
136
|
+
allow(File).to receive(:exist?).with(@description).and_return(true)
|
125
137
|
|
126
|
-
expect{subject}.to raise_error(
|
138
|
+
expect { subject }.to raise_error(%r{Feature file not found\. Tried: .*/spec/rutabaga/util\.feature})
|
127
139
|
end
|
128
140
|
end
|
129
141
|
end
|
data/spec/spec_helper.rb
CHANGED
metadata
CHANGED
@@ -1,49 +1,49 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rutabaga
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.0
|
4
|
+
version: 3.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Lukas Oberhuber
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2022-11-11 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
|
-
name:
|
14
|
+
name: rspec
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- - "
|
18
|
-
- !ruby/object:Gem::Version
|
19
|
-
version: 3.1.0
|
20
|
-
- - "<"
|
17
|
+
- - "~>"
|
21
18
|
- !ruby/object:Gem::Version
|
22
|
-
version: '
|
19
|
+
version: '3.0'
|
23
20
|
type: :runtime
|
24
21
|
prerelease: false
|
25
22
|
version_requirements: !ruby/object:Gem::Requirement
|
26
23
|
requirements:
|
27
|
-
- - "
|
28
|
-
- !ruby/object:Gem::Version
|
29
|
-
version: 3.1.0
|
30
|
-
- - "<"
|
24
|
+
- - "~>"
|
31
25
|
- !ruby/object:Gem::Version
|
32
|
-
version: '
|
26
|
+
version: '3.0'
|
33
27
|
- !ruby/object:Gem::Dependency
|
34
|
-
name:
|
28
|
+
name: turnip
|
35
29
|
requirement: !ruby/object:Gem::Requirement
|
36
30
|
requirements:
|
37
|
-
- - "
|
31
|
+
- - ">="
|
38
32
|
- !ruby/object:Gem::Version
|
39
|
-
version:
|
33
|
+
version: 3.1.0
|
34
|
+
- - "<"
|
35
|
+
- !ruby/object:Gem::Version
|
36
|
+
version: '4.4'
|
40
37
|
type: :runtime
|
41
38
|
prerelease: false
|
42
39
|
version_requirements: !ruby/object:Gem::Requirement
|
43
40
|
requirements:
|
44
|
-
- - "
|
41
|
+
- - ">="
|
45
42
|
- !ruby/object:Gem::Version
|
46
|
-
version:
|
43
|
+
version: 3.1.0
|
44
|
+
- - "<"
|
45
|
+
- !ruby/object:Gem::Version
|
46
|
+
version: '4.4'
|
47
47
|
- !ruby/object:Gem::Dependency
|
48
48
|
name: capybara
|
49
49
|
requirement: !ruby/object:Gem::Requirement
|
@@ -79,14 +79,20 @@ executables: []
|
|
79
79
|
extensions: []
|
80
80
|
extra_rdoc_files: []
|
81
81
|
files:
|
82
|
+
- ".github/workflows/ci.yml"
|
83
|
+
- ".github/workflows/codeql-analysis.yml"
|
84
|
+
- ".github/workflows/gempush.yml"
|
85
|
+
- ".github/workflows/project-board.yml"
|
86
|
+
- ".github/workflows/rubocop-analysis.yml"
|
82
87
|
- ".gitignore"
|
83
|
-
- ".travis.yml"
|
84
88
|
- CHANGELOG.md
|
89
|
+
- CODEOWNERS
|
85
90
|
- Gemfile
|
86
91
|
- Gemfile.turnip3
|
87
92
|
- LICENSE
|
88
93
|
- README.md
|
89
94
|
- Rakefile
|
95
|
+
- catalog-info.yaml
|
90
96
|
- examples/compatibility/compatibility_spec.rb
|
91
97
|
- examples/pattern/test_pattern_spec.rb
|
92
98
|
- examples/spec_helper.rb
|
@@ -132,16 +138,9 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
132
138
|
- !ruby/object:Gem::Version
|
133
139
|
version: '0'
|
134
140
|
requirements: []
|
135
|
-
rubygems_version: 3.
|
141
|
+
rubygems_version: 3.3.7
|
136
142
|
signing_key:
|
137
143
|
specification_version: 4
|
138
144
|
summary: Calling Turnip feature files from RSpec, which allows encapsulating a feature
|
139
145
|
inside a describe block
|
140
|
-
test_files:
|
141
|
-
- spec/feature_spec.rb
|
142
|
-
- spec/features/fixture.feature
|
143
|
-
- spec/formatter_spec.rb
|
144
|
-
- spec/no_turnip_spec.rb
|
145
|
-
- spec/rspec_formatter/formatter.rb
|
146
|
-
- spec/rutabaga/util_spec.rb
|
147
|
-
- spec/spec_helper.rb
|
146
|
+
test_files: []
|
data/.travis.yml
DELETED
@@ -1,17 +0,0 @@
|
|
1
|
-
language: ruby
|
2
|
-
rvm:
|
3
|
-
- 2.4
|
4
|
-
- 2.5
|
5
|
-
- 2.6
|
6
|
-
- jruby
|
7
|
-
|
8
|
-
gemfile:
|
9
|
-
- Gemfile
|
10
|
-
- ./Gemfile.turnip3
|
11
|
-
|
12
|
-
matrix:
|
13
|
-
allow_failures:
|
14
|
-
- rvm: jruby # Google protobuf, requirement for turnip 4 not compatible yet
|
15
|
-
gemfile: Gemfile
|
16
|
-
|
17
|
-
script: bundle exec rspec spec
|