cucumber-rails 2.4.0 → 2.5.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: d764b02e53187004f18c9fdc74de22286dde7a2844bb453c5dc807faaaa20b0b
4
- data.tar.gz: 24b459b96e9f4c904c7c4b075bff63cf360e65b26b0c90b78d611bd5edab9af8
3
+ metadata.gz: 9e1cd2904e66669d6acf0468d21a4a3e28ac560bae247cf683f9c0e237e2cd11
4
+ data.tar.gz: 7edc69638a3946df0ac20707ce080c45361b8cab885171ba370191d84f5268b3
5
5
  SHA512:
6
- metadata.gz: 14035d2a0e522ae20fc396e8b3eea3f3f0dc78631bfb7d15ff6d3fe77763463aa0ccfc088296952bbfd3cfcefff6b0a0a64bf4bdc7eb4b6b38e44a822bb9eb97
7
- data.tar.gz: a3d599cc9cdb5de6f2db472bbbacfafeddbf11699eb6bf05103c3b6b3f8d31f7a620bbb97786a2c74e09ecce3712e4942828e2c8e1a8f01efbfe2db1d054280b
6
+ metadata.gz: eda48ea91bc84b2d3a4008dc8424c79e5ab3173dfaab739ed309f75619f8741899c12ba67c0d221be73aa6f052ebd7fe60e7cded149cfa4d4de19b59bfc3633e
7
+ data.tar.gz: 91f48677c021ad17c08b8a8fd50223c6942f7042ebfef1d68b3def47207cefecf73e45e5f955c881a3d180d9b8d821e87162bdd1dcaade16a702acbc66ed9bce
data/CHANGELOG.md CHANGED
@@ -1,20 +1,32 @@
1
1
  Please see [CONTRIBUTING.md](https://github.com/cucumber/cucumber/blob/master/CONTRIBUTING.md)
2
2
  on how to contribute to Cucumber.
3
3
 
4
- ## [main](https://github.com/cucumber/cucumber-rails/compare/v2.4.0...main) (Not yet released)
4
+ ## [main](https://github.com/cucumber/cucumber-rails/compare/v2.5.0...main) (Not yet released)
5
5
 
6
6
  ### New Features
7
7
 
8
- *
8
+
9
9
 
10
10
  ### Changed
11
11
 
12
- *
12
+
13
13
 
14
14
  ### Fixed
15
15
 
16
16
  *
17
17
 
18
+ ## [v2.5.0](https://github.com/cucumber/cucumber-rails/compare/v2.4.0...v2.5.0) (2022-03-07)
19
+
20
+ ### New Features
21
+
22
+ * Added `:none` option for `javascript_strategy` which indicates no special handling of `@javascript` tagged tests ([#522](https://github.com/cucumber/cucumber-rails/pull/522) [akostadinov])
23
+ * Added support for Rails 7 ([#526](https://github.com/cucumber/cucumber-rails/pull/526/) [mgrunberg])
24
+ * Added Ruby 3.1 support ([#529](https://github.com/cucumber/cucumber-rails/pull/529) [mgrunberg])
25
+
26
+ ### Changed
27
+
28
+ * Dropped Ruby 2.4 support ([#529](https://github.com/cucumber/cucumber-rails/pull/529) [mgrunberg])
29
+
18
30
  ## [v2.4.0](https://github.com/cucumber/cucumber-rails/compare/v2.3.0...v2.4.0) (2021-07-21)
19
31
 
20
32
  ### New Features
data/README.md CHANGED
@@ -7,7 +7,7 @@
7
7
  [![pull requests](https://oselvar.com/api/badge?label=pull%20requests&csvUrl=https%3A%2F%2Fraw.githubusercontent.com%2Fcucumber%2Foselvar-github-metrics%2Fmain%2Fdata%2Fcucumber%2Fcucumber-rails%2FpullRequests.csv)](https://oselvar.com/github/cucumber/oselvar-github-metrics/main/cucumber/cucumber-rails)
8
8
  [![issues](https://oselvar.com/api/badge?label=issues&csvUrl=https%3A%2F%2Fraw.githubusercontent.com%2Fcucumber%2Foselvar-github-metrics%2Fmain%2Fdata%2Fcucumber%2Fcucumber-rails%2Fissues.csv)](https://oselvar.com/github/cucumber/oselvar-github-metrics/main/cucumber/cucumber-rails)
9
9
 
10
- Cucumber-Rails brings Cucumber to Rails 5.x and 6.x.
10
+ Cucumber-Rails brings Cucumber to Rails 5.x, 6.x and 7.x.
11
11
 
12
12
  ## Installation
13
13
 
@@ -7,27 +7,42 @@ module Cucumber
7
7
  module SelectDatesAndTimes
8
8
  # Select a Rails date. Options hash must include from: +label+
9
9
  def select_date(date, options)
10
- date = Date.parse(date)
11
- base_dom_id = get_base_dom_id_from_label_tag(options[:from])
12
-
13
- find(:xpath, ".//select[@id='#{base_dom_id}_1i']").select(date.year.to_s)
14
- find(:xpath, ".//select[@id='#{base_dom_id}_2i']").select(I18n.l(date, format: '%B'))
15
- find(:xpath, ".//select[@id='#{base_dom_id}_3i']").select(date.day.to_s)
10
+ date = Date.parse(date)
11
+ if ::Rails::VERSION::MAJOR >= 7
12
+ # Rails 7 generates date fields using input type="date". Capybara support's them
13
+ fill_in options[:from], with: date
14
+ else
15
+ base_dom_id = get_base_dom_id_from_label_tag(options[:from])
16
+
17
+ find(:xpath, ".//select[@id='#{base_dom_id}_1i']").select(date.year.to_s)
18
+ find(:xpath, ".//select[@id='#{base_dom_id}_2i']").select(I18n.l(date, format: '%B'))
19
+ find(:xpath, ".//select[@id='#{base_dom_id}_3i']").select(date.day.to_s)
20
+ end
16
21
  end
17
22
 
18
23
  # Select a Rails time. Options hash must include from: +label+
19
24
  def select_time(time, options)
20
- time = Time.zone.parse(time)
21
- base_dom_id = get_base_dom_id_from_label_tag(options[:from])
22
-
23
- find(:xpath, ".//select[@id='#{base_dom_id}_4i']").select(time.hour.to_s.rjust(2, '0'))
24
- find(:xpath, ".//select[@id='#{base_dom_id}_5i']").select(time.min.to_s.rjust(2, '0'))
25
+ time = Time.zone.parse(time)
26
+ if ::Rails::VERSION::MAJOR >= 7
27
+ # Rails 7 generates date fields using input type="time". Capybara support's them
28
+ fill_in options[:from], with: time
29
+ else
30
+ base_dom_id = get_base_dom_id_from_label_tag(options[:from])
31
+
32
+ find(:xpath, ".//select[@id='#{base_dom_id}_4i']").select(time.hour.to_s.rjust(2, '0'))
33
+ find(:xpath, ".//select[@id='#{base_dom_id}_5i']").select(time.min.to_s.rjust(2, '0'))
34
+ end
25
35
  end
26
36
 
27
37
  # Select a Rails datetime. Options hash must include from: +label+
28
38
  def select_datetime(datetime, options)
29
- select_date(datetime, options)
30
- select_time(datetime, options)
39
+ if ::Rails::VERSION::MAJOR >= 7
40
+ # Rails 7 generates datetime fields using input type="datetime-local". Capybara support's them
41
+ fill_in options[:from], with: DateTime.parse(datetime)
42
+ else
43
+ select_date(datetime, options)
44
+ select_time(datetime, options)
45
+ end
31
46
  end
32
47
 
33
48
  private
@@ -0,0 +1,15 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Cucumber
4
+ module Rails
5
+ module Database
6
+ class NullStrategy
7
+ def before_js; end
8
+
9
+ def before_non_js; end
10
+
11
+ def after; end
12
+ end
13
+ end
14
+ end
15
+ end
@@ -49,7 +49,8 @@ module Cucumber
49
49
  truncation: TruncationStrategy,
50
50
  shared_connection: SharedConnectionStrategy,
51
51
  transaction: SharedConnectionStrategy,
52
- deletion: DeletionStrategy
52
+ deletion: DeletionStrategy,
53
+ none: NullStrategy
53
54
  }
54
55
  end
55
56
 
@@ -24,6 +24,7 @@ if called_from_env_rb
24
24
  require 'cucumber/rails/capybara'
25
25
  require 'cucumber/rails/database/strategy'
26
26
  require 'cucumber/rails/database/deletion_strategy'
27
+ require 'cucumber/rails/database/null_strategy'
27
28
  require 'cucumber/rails/database/shared_connection_strategy'
28
29
  require 'cucumber/rails/database/truncation_strategy'
29
30
  require 'cucumber/rails/database'
@@ -61,15 +61,15 @@ module Cucumber
61
61
  protected
62
62
 
63
63
  def embed_file(source, indent = '')
64
- IO.read(File.join(self.class.source_root, source)).gsub(/^/, indent)
64
+ File.read(File.join(self.class.source_root, source)).gsub(/^/, indent)
65
65
  end
66
66
 
67
67
  def embed_template(source, indent = '')
68
68
  template = File.join(self.class.source_root, source)
69
69
  if RUBY_VERSION >= '2.6'
70
- ERB.new(IO.read(template), trim_mode: '-').result(binding).gsub(/^/, indent)
70
+ ERB.new(File.read(template), trim_mode: '-').result(binding).gsub(/^/, indent)
71
71
  else
72
- ERB.new(IO.read(template), nil, '-').result(binding).gsub(/^/, indent)
72
+ ERB.new(File.read(template), nil, '-').result(binding).gsub(/^/, indent)
73
73
  end
74
74
  end
75
75
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cucumber-rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.4.0
4
+ version: 2.5.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Aslak Hellesøy
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2021-07-21 00:00:00.000000000 Z
13
+ date: 2022-03-07 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: capybara
@@ -89,7 +89,7 @@ dependencies:
89
89
  version: '5.0'
90
90
  - - "<"
91
91
  - !ruby/object:Gem::Version
92
- version: '7'
92
+ version: '8'
93
93
  type: :runtime
94
94
  prerelease: false
95
95
  version_requirements: !ruby/object:Gem::Requirement
@@ -99,7 +99,7 @@ dependencies:
99
99
  version: '5.0'
100
100
  - - "<"
101
101
  - !ruby/object:Gem::Version
102
- version: '7'
102
+ version: '8'
103
103
  - !ruby/object:Gem::Dependency
104
104
  name: rexml
105
105
  requirement: !ruby/object:Gem::Requirement
@@ -238,14 +238,14 @@ dependencies:
238
238
  requirements:
239
239
  - - "~>"
240
240
  - !ruby/object:Gem::Version
241
- version: 1.7.0
241
+ version: 1.24.0
242
242
  type: :development
243
243
  prerelease: false
244
244
  version_requirements: !ruby/object:Gem::Requirement
245
245
  requirements:
246
246
  - - "~>"
247
247
  - !ruby/object:Gem::Version
248
- version: 1.7.0
248
+ version: 1.24.0
249
249
  - !ruby/object:Gem::Dependency
250
250
  name: rubocop-packaging
251
251
  requirement: !ruby/object:Gem::Requirement
@@ -348,6 +348,7 @@ files:
348
348
  - lib/cucumber/rails/capybara/select_dates_and_times.rb
349
349
  - lib/cucumber/rails/database.rb
350
350
  - lib/cucumber/rails/database/deletion_strategy.rb
351
+ - lib/cucumber/rails/database/null_strategy.rb
351
352
  - lib/cucumber/rails/database/shared_connection_strategy.rb
352
353
  - lib/cucumber/rails/database/strategy.rb
353
354
  - lib/cucumber/rails/database/truncation_strategy.rb
@@ -373,10 +374,10 @@ licenses:
373
374
  - MIT
374
375
  metadata:
375
376
  bug_tracker_uri: https://github.com/cucumber/cucumber-rails/issues
376
- changelog_uri: https://github.com/cucumber/cucumber-rails/blob/v2.4.0/CHANGELOG.md
377
+ changelog_uri: https://github.com/cucumber/cucumber-rails/blob/v2.5.0/CHANGELOG.md
377
378
  documentation_uri: https://cucumber.io/docs
378
379
  mailing_list_uri: https://groups.google.com/forum/#!forum/cukes
379
- source_code_uri: https://github.com/cucumber/cucumber-rails/tree/v2.4.0
380
+ source_code_uri: https://github.com/cucumber/cucumber-rails/tree/v2.5.0
380
381
  post_install_message:
381
382
  rdoc_options: []
382
383
  require_paths:
@@ -385,7 +386,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
385
386
  requirements:
386
387
  - - ">="
387
388
  - !ruby/object:Gem::Version
388
- version: 2.4.0
389
+ version: 2.5.0
389
390
  required_rubygems_version: !ruby/object:Gem::Requirement
390
391
  requirements:
391
392
  - - ">="
@@ -395,5 +396,5 @@ requirements: []
395
396
  rubygems_version: 3.1.2
396
397
  signing_key:
397
398
  specification_version: 4
398
- summary: cucumber-rails-2.4.0
399
+ summary: cucumber-rails-2.5.0
399
400
  test_files: []