File tree Expand file tree Collapse file tree 2 files changed +23
-22
lines changed Expand file tree Collapse file tree 2 files changed +23
-22
lines changed Original file line number Diff line number Diff line change @@ -22,28 +22,7 @@ RSpec::Core::RakeTask.new(:spec) do |t|
2222 t . rspec_opts = %w[ --color ]
2323end
2424
25- Cucumber ::Rake ::Task . new ( :cucumber ) do |t |
26- string_version = ENV . fetch ( "RAILS_VERSION" , "~> 6.0.0" )
27- version =
28- if string_version == "master" || string_version . nil?
29- Float ::INFINITY
30- else
31- string_version [ /\d [\. -]\d / ] . tr ( '-' , '.' )
32- end
33- tags = [ ]
34-
35- if version . to_f >= 6.0
36- tags << "'not @rails_pre_6'"
37- end
38-
39- if version . to_f < 6.0
40- tags << "'not @rails_post_6'"
41- end
42-
43- cucumber_flag = tags . map { |tag | "--tag #{ tag } " }
44-
45- t . cucumber_opts = cucumber_flag
46- end
25+ Cucumber ::Rake ::Task . new ( :cucumber )
4726
4827namespace :generate do
4928 desc "generate a fresh app with rspec installed"
Original file line number Diff line number Diff line change 1+ def rails_version
2+ string_version = ENV . fetch ( "RAILS_VERSION" , "~> 6.0.0" )
3+ if string_version == "master" || string_version . nil?
4+ Float ::INFINITY
5+ else
6+ string_version [ /\d [\. -]\d / ] . tr ( '-' , '.' )
7+ end
8+ end
9+
10+ Before "@rails_pre_6" do |scenario |
11+ if rails_version . to_f >= 6.0
12+ warn "Skipping scenario #{ scenario . name } on Rails v#{ rails_version } "
13+ skip_this_scenario
14+ end
15+ end
16+
17+ Before "@rails_post_6" do |scenario |
18+ if rails_version . to_f < 6.0
19+ warn "Skipping scenario #{ scenario . name } on Rails v#{ rails_version } "
20+ skip_this_scenario
21+ end
22+ end
You can’t perform that action at this time.
0 commit comments