This repository was archived by the owner on Nov 30, 2024. It is now read-only.
File tree 11 files changed +38
-14
lines changed
11 files changed +38
-14
lines changed Original file line number Diff line number Diff line change @@ -94,6 +94,10 @@ if RUBY_VERSION < '2.4.0'
94
94
gem 'minitest' , '< 5.12.0'
95
95
end
96
96
97
+ if RUBY_VERSION < '2.0.0'
98
+ gem 'cucumber' , "<= 1.3.22"
99
+ end
100
+
97
101
gem 'contracts' , '< 0.16' if RUBY_VERSION < '1.9.0'
98
102
99
103
eval File . read ( 'Gemfile-custom' ) if File . exist? ( 'Gemfile-custom' )
Original file line number Diff line number Diff line change 1
1
<%
2
+
3
+ USE_TILDE_TAGS = !defined?(::RUBY_ENGINE_VERSION) || (::RUBY_ENGINE_VERSION < '2.0.0')
4
+ NOT_WIP_TAG = USE_TILDE_TAGS ? '~@wip' : '"not @wip"'
5
+ NOT_JRUBY_TAG = USE_TILDE_TAGS ? '~@no-jruby' : '"not @no-jruby"'
6
+
2
7
exclusions = []
3
- exclusions << ' --tags ~@no-jruby' if RUBY_PLATFORM == 'java'
8
+ exclusions << " --tags #{NOT_JRUBY_TAG}" if RUBY_PLATFORM == 'java'
4
9
% >
5
- default : --require features --strict --format progress --tags ~@wip <%= exclusions.join %> features
10
+ default : --require features --strict --format progress --tags <%= NOT_WIP_TAG %> <%= exclusions.join %> features
6
11
wip : --require features --tags @wip:30 --wip features
Original file line number Diff line number Diff line change @@ -25,7 +25,7 @@ Feature: `--init` option
25
25
Scenario : Accept and use the recommended settings in `spec_helper` (which are initially commented out)
26
26
Given I have a brand new project with no files
27
27
And I have run `rspec --init`
28
- When I accept the recommended settings by removing `=begin` and `=end` from `spec/ spec_helper.rb`
28
+ When I accept the recommended settings by removing `=begin` and `=end` from `spec_helper.rb`
29
29
And I create "spec/addition_spec.rb" with the following content:
30
30
"""ruby
31
31
RSpec.describe "Addition" do
Original file line number Diff line number Diff line change @@ -6,7 +6,11 @@ Feature: described class
6
6
Scenario : Access the described class from the example
7
7
Given a file named "spec/example_spec.rb" with:
8
8
"""ruby
9
- RSpec.describe Fixnum do
9
+ RSpec.describe Symbol do
10
+ it "is available as described_class" do
11
+ expect(described_class).to eq(Symbol)
12
+ end
13
+
10
14
describe 'inner' do
11
15
describe String do
12
16
it "is available as described_class" do
Original file line number Diff line number Diff line change 114
114
set_environment_variable ( 'RUBYOPT' , ENV [ 'RUBYOPT' ] + " -I#{ gem_dir } /lib" )
115
115
end
116
116
117
- When " I accept the recommended settings by removing `=begin` and `=end` from `spec/ spec_helper.rb`" do
117
+ When ( ' I accept the recommended settings by removing `=begin` and `=end` from `spec_helper.rb`' ) do
118
118
cd ( '.' ) do
119
119
spec_helper = File . read ( "spec/spec_helper.rb" )
120
120
expect ( spec_helper ) . to include ( "=begin" , "=end" )
Original file line number Diff line number Diff line change 1
1
require 'diff-lcs'
2
2
3
3
Around "@skip-when-diff-lcs-1.4" do |scenario , block |
4
- if Diff ::LCS ::VERSION . to_f >= 1.4
5
- warn "Skipping scenario #{ scenario . title } on `diff-lcs` v#{ Diff ::LCS ::VERSION . to_f } "
4
+ if Diff ::LCS ::VERSION >= ' 1.4'
5
+ skip_this_scenario "Skipping scenario #{ scenario . name } on `diff-lcs` v#{ Diff ::LCS ::VERSION } "
6
6
else
7
7
block . call
8
8
end
9
9
end
10
10
11
11
Around "@skip-when-diff-lcs-1.3" do |scenario , block |
12
- if Diff ::LCS ::VERSION . to_f < 1.4
13
- warn "Skipping scenario #{ scenario . title } on `diff-lcs` v#{ Diff ::LCS ::VERSION . to_f } "
12
+ if Diff ::LCS ::VERSION < ' 1.4'
13
+ skip_this_scenario "Skipping scenario #{ scenario . name } on `diff-lcs` v#{ Diff ::LCS ::VERSION } "
14
14
else
15
15
block . call
16
16
end
Original file line number Diff line number Diff line change 1
1
Around "@broken-on-jruby-9000" do |scenario , block |
2
2
require 'rspec/support/ruby_features'
3
- block . call unless RSpec ::Support ::Ruby . jruby_9000?
3
+ if RSpec ::Support ::Ruby . jruby_9000?
4
+ skip_this_scenario "Skipping scenario #{ scenario . name } not supported on JRuby 9000"
5
+ else
6
+ block . call
7
+ end
4
8
end
Original file line number Diff line number Diff line change 1
1
if defined? ( Cucumber )
2
2
require 'shellwords'
3
- Before ( '~@allow-should-syntax' , '~@with-clean-spec-opts' ) do
3
+ use_tilde_tags = !defined? ( ::RUBY_ENGINE_VERSION ) || ( ::RUBY_ENGINE_VERSION < '2.0.0' )
4
+ exclude_allow_should_syntax = use_tilde_tags ? '~@allow-should-syntax' : 'not @allow-should-syntax'
5
+ exclude_with_clean_spec_ops = use_tilde_tags ? '~@with-clean-spec-opts' : 'not @with-clean-spec-opts'
6
+ Before ( exclude_allow_should_syntax , exclude_with_clean_spec_ops ) do
4
7
set_environment_variable ( 'SPEC_OPTS' , "-r#{ Shellwords . escape ( __FILE__ ) } " )
5
8
end
6
9
Original file line number Diff line number Diff line change 2
2
ENV [ 'RBXOPT' ] = "#{ ENV [ "RBXOPT" ] } -Xcompiler.no_rbc"
3
3
4
4
Around "@unsupported-on-rbx" do |scenario , block |
5
- block . call unless defined? ( Rubinius )
5
+ if defined? ( Rubinius )
6
+ block . call
7
+ else
8
+ skip_this_scenario "Skipping scenario #{ scenario . name } not supported on Rubinius"
9
+ end
6
10
end
Original file line number Diff line number Diff line change 2
2
if RUBY_VERSION . to_f == 2.7
3
3
block . call
4
4
else
5
- warn "Skipping scenario #{ scenario . title } on Ruby v#{ RUBY_VERSION } "
5
+ skip_this_scenario "Skipping scenario #{ scenario . name } on Ruby v#{ RUBY_VERSION } "
6
6
end
7
7
end
Original file line number Diff line number Diff line change @@ -45,7 +45,7 @@ Gem::Specification.new do |s|
45
45
s . add_runtime_dependency "rspec-support" , "~> #{ RSpec ::Core ::Version ::STRING . split ( '.' ) [ 0 ..1 ] . concat ( [ '0' ] ) . join ( '.' ) } "
46
46
end
47
47
48
- s . add_development_dependency "cucumber" , "~> 1.3"
48
+ s . add_development_dependency "cucumber" , ">= 1.3"
49
49
s . add_development_dependency "minitest" , "~> 5.3"
50
50
s . add_development_dependency "aruba" , "~> 0.14.9"
51
51
You can’t perform that action at this time.
0 commit comments