spreewald 4.4.0 → 4.4.1

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
  SHA256:
3
- metadata.gz: 9629a83474d8c49dcdee707d4375c5870f2be6e62319298aa78daf4f7b094371
4
- data.tar.gz: 2825ae8cf7120966658b4c95d87d817ff25502de599db659d5ba58bde0583704
3
+ metadata.gz: 892a8b1fc2985989a10ad303aa6be9a65a4ea3542bea9c5d9311fb0f1463b73a
4
+ data.tar.gz: 2031b66e60406bd9205204a6355fc0f745eed30abf3b14095121f9b04290610e
5
5
  SHA512:
6
- metadata.gz: a809506ac52895e6977f0e04382a1f84c4f1c7e90bfbdb5d21621f704b38a88b3f3b01206f15bc4cf7329b189783aa814ff35a5b879ac95a59077c7663861441
7
- data.tar.gz: dc3d04ba83808692024a9a6081c0246b35157aacc74368026d69a2fcfcf4d182b0fcbb609decc094541863ff809f6aec1177d32e3c41424719b686589cec01c8
6
+ metadata.gz: e7c84b276c5b1cca99a3beac23d656d206ae68cc8f74b17ca3b316b59703249611c226c85d1cc17305faf588e56a1b689d213b916251db4e876c3644c48ee893
7
+ data.tar.gz: a61b5d8dd7bf93dca91ea19a69d77de47ddb79b251bacf4ed37b79b1cab91972ea5c2f995d05f9ccf2d83f5a6f37b36882a14ffba178399380da192495a7ac34
data/CHANGELOG.md CHANGED
@@ -3,6 +3,13 @@ All notable changes to this project will be documented in this file.
3
3
 
4
4
  This project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).
5
5
 
6
+ ## 4.4.1
7
+ - Fix deprecation warning for `ActiveRecord::Base.default_timezone` when running with Rails 7.0 ([#191](https://github.com/makandra/spreewald/issues/191))
8
+ - Fix deprecation warning for using keyword arguments as last argument when running with ruby 2.7 ([#192](https://github.com/makandra/spreewald/issues/192))
9
+
10
+ ## 4.4.0
11
+ - Add support for Rails 7.0
12
+
6
13
  ## 4.3.6
7
14
  - Use capybara's `make_visible` [option](https://github.com/teamcapybara/capybara/blob/0468de5a810aae75ab9de20447e246c5c35473f0/lib/capybara/node/actions.rb#L279) in step `I attach the file "..." to "..."`
8
15
  - This will make CSS-Hacks like setting the opacity in tests obsolete
@@ -33,8 +40,8 @@ did not find the correct elements
33
40
  - The search via `spreewald some query here` includes steps with optional negation now.
34
41
 
35
42
  ## 4.2.2
36
- - Fixes the "Show me the email" step (#171)
37
- - Fixes the "I follow the link in the email" step. (#172, #173)
43
+ - Fixes the "Show me the email" step ([#171](https://github.com/makandra/spreewald/issues/171))
44
+ - Fixes the "I follow the link in the email" step. ([#172](https://github.com/makandra/spreewald/issues/172), [#173](https://github.com/makandra/spreewald/issues/173))
38
45
  - It works for emails with and without explicit html parts
39
46
  - There's a better error message if no links are found
40
47
 
@@ -42,7 +49,7 @@ did not find the correct elements
42
49
  - Multiple invocations of console don't raise anymore
43
50
 
44
51
  ## 4.1.1
45
- - The step `I open .. in a new browser tab` is now using the `noopener` option (see issue [#174])
52
+ - The step `I open .. in a new browser tab` is now using the `noopener` option (see issue [#174](https://github.com/makandra/spreewald/issues/174))
46
53
 
47
54
  ## 4.1.0
48
55
 
@@ -218,7 +225,7 @@ The "it should work" step now takes an optional reason.
218
225
  The word "within" can now be used in arguments for other steps without causing errors ([Issue #53](https://github.com/makandra/spreewald/issues/80))
219
226
 
220
227
  ## 1.12.3
221
- Prevent wall of warnings when `Then console` is used multiple times in on test run ([issue](https://github.com/makandra/spreewald/issues/80))
228
+ Prevent wall of warnings when `Then console` is used multiple times in on test run ([issue #80](https://github.com/makandra/spreewald/issues/80))
222
229
 
223
230
  ## 1.12.2
224
231
  Always check the current driver by its class (see [issue](https://github.com/makandra/spreewald/issues/74))
data/README.md CHANGED
@@ -6,7 +6,7 @@ You can find a list of all contained steps at the end of this README.
6
6
 
7
7
  ## Supported versions
8
8
 
9
- Spreewald is currently tested against and Ruby 2.6.6 and 3.0.0 with Rails 6 and Capybara 3.
9
+ Spreewald is currently tested against and Ruby 2.6.6 and 3.0.0 with Rails 7 and Capybara 3.
10
10
 
11
11
  ## Installation
12
12
 
@@ -22,7 +22,7 @@ if defined?(Timecop) || is_at_least_rails_4_1
22
22
 
23
23
  def use_timezones?
24
24
  active_record_loaded = defined?(ActiveRecord::Base)
25
- (!active_record_loaded || ActiveRecord::Base.default_timezone != :local) && Time.zone
25
+ (!active_record_loaded || default_timezone != :local) && Time.zone
26
26
  end
27
27
 
28
28
  def parse_time(str)
@@ -41,6 +41,14 @@ if defined?(Timecop) || is_at_least_rails_4_1
41
41
  end
42
42
  end
43
43
 
44
+ def default_timezone
45
+ if ActiveRecord.respond_to?(:default_timezone)
46
+ ActiveRecord.default_timezone
47
+ else
48
+ ActiveRecord::Base.default_timezone
49
+ end
50
+ end
51
+
44
52
  if defined?(Timecop)
45
53
  # Emulate ActiveSupport time helper methods with Timecop - don't rename these methods
46
54
  def travel(duration)
@@ -48,7 +48,8 @@ When /^(.*) within (.*[^:])$/ do |nested_step, parent|
48
48
  selector = _selector_for(parent)
49
49
  if selector.is_a?(String) || selector.is_a?(Array) # could also be a Capybara::Node::Element
50
50
  patiently do
51
- expect(page).to have_selector(*selector)
51
+ args, kwargs = deconstruct_selector(selector)
52
+ expect(page).to have_selector(*args, **kwargs)
52
53
  end
53
54
  end
54
55
  patiently do
@@ -31,7 +31,25 @@ World(PathSelectorFallbacks)
31
31
 
32
32
  module WithinHelpers
33
33
  def with_scope(locator)
34
- locator ? within(*_selector_for(locator)) { yield } : yield
34
+ if locator
35
+ selector = _selector_for(locator)
36
+ args, kwargs = deconstruct_selector(selector)
37
+ within(*args, **kwargs) { yield }
38
+ else
39
+ yield
40
+ end
41
+ end
42
+
43
+ def deconstruct_selector(selector)
44
+ if selector.is_a?(Array)
45
+ if selector[-1].is_a?(Hash) # selector with keyword arguments, e.g. ['.foo', { text: 'bar', visible: :all }]
46
+ [selector[0...-1], **selector[-1]]
47
+ else # xpath selector, e.g. [:xpath, '//header']
48
+ [selector, {}]
49
+ end
50
+ else # String or Capybara::Node::Element
51
+ [selector, {}]
52
+ end
35
53
  end
36
54
  end
37
55
  World(WithinHelpers)
@@ -1,3 +1,3 @@
1
1
  module Spreewald
2
- VERSION = '4.4.0'
2
+ VERSION = '4.4.1'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: spreewald
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.4.0
4
+ version: 4.4.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tobias Kraze
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-04-22 00:00:00.000000000 Z
11
+ date: 2022-06-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: cucumber