capybara-experience 0.3.2 → 0.3.4

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: 1fa20ed37708148de49cef701b1a01f8bb178e265aa7e90fd5f0669a60850147
4
- data.tar.gz: a7becb3e8c47766a43bc2aa0a5f5ea327042d1b3860342cc4e21ce42966001be
3
+ metadata.gz: 84a97377aa40b425565277472cb8508fd305f9288b77876f40e760291b623eda
4
+ data.tar.gz: c47a957680c97755d48f47df1430b111e920bf79a06e1e64ba0e9e53a4260b41
5
5
  SHA512:
6
- metadata.gz: 299a7d14d66b32ee67f19275bce4ede292e2d29c14faddb0561205fde708a2a8dd65133900dd0dc40eadc0f91f931302fcb72d3d8c198e595f1841f6ae2f1d50
7
- data.tar.gz: 3c6fae1f8bebef030e7ff554b73a30d022c3553de3b75cc0822645f92332507698800ed5c8076ac37441098b9dfeb6e0f8419eefbc04d135809b552b33e0b5dc
6
+ metadata.gz: b5b283908c6c0076883a8bad1e6dab873cb643e5109fb071f539a4cc12fe3844f52e4e92a5c4b96b0739ff00989e6abdb170725045f850ac22ab0de223c4ee6b
7
+ data.tar.gz: d544901d7cd5b30600b37f8ebfce1e074e028c805b776a4813a034f71ef4f79193e52a3b42d63d74ea64cf3f16c2fe2ba3875c9f592bb585ebbbcbe1b67251ce
data/Gemfile CHANGED
@@ -2,3 +2,5 @@ source "https://rubygems.org"
2
2
 
3
3
  # Specify your gem's dependencies in capybara-experience.gemspec
4
4
  gemspec
5
+
6
+ gem "pry-byebug"
@@ -28,6 +28,7 @@ Gem::Specification.new do |spec|
28
28
  spec.add_development_dependency "bundler", "~> 2.0"
29
29
  spec.add_development_dependency "rake", "~> 10.0"
30
30
  spec.add_development_dependency "rspec", "~> 3.0"
31
+ spec.add_development_dependency "sinatra", ">= 3.0.2"
31
32
 
32
33
  spec.add_runtime_dependency "capybara", "~> 3.0"
33
34
  end
@@ -9,7 +9,7 @@ module Capybara
9
9
  def [](key)
10
10
  super(key) || begin
11
11
  driver, _session_name, app_object_id = key.split(":")
12
- take(driver: driver, app_object_id: app_object_id, key: key)
12
+ take(driver: driver.to_sym, app_object_id: app_object_id.to_i, key: key)
13
13
  end
14
14
  end
15
15
 
@@ -36,9 +36,10 @@ module Capybara
36
36
  end
37
37
 
38
38
  def reset_idle!
39
- dup.each do |key, session|
40
- self[session_key(session)] = delete(key)
39
+ new_hash = each_with_object({}) do |(key, session), hash|
40
+ hash[session_key(session)] = delete(key)
41
41
  end
42
+ replace(new_hash)
42
43
  @idle = values
43
44
 
44
45
  nil
@@ -15,7 +15,9 @@ module Capybara
15
15
 
16
16
  def refresh_description
17
17
  metadata[:description] = metadata[:description_args].join(" ")
18
- metadata[:full_description] = [metadata[:example_group][:full_description]].concat(metadata[:description_args]).join(" ")
18
+ metadata[:full_description] =
19
+ [metadata[:example_group][:full_description]]
20
+ .concat(metadata[:description_args]).join(" ")
19
21
  end
20
22
 
21
23
  def metadata
@@ -23,13 +25,13 @@ module Capybara
23
25
  end
24
26
 
25
27
  def in_continuous_integration_env?
26
- ENV["CI"].present?
28
+ ENV["CI"]&.empty?
27
29
  end
28
30
  end
29
31
 
30
32
  RSpec.configure do |config|
31
33
  config.include BehaviorDSL
32
- config.prepend_after :each, type: :feature, js: true do
34
+ config.after :each, type: :feature, js: true do
33
35
  Capybara::Experience::Pool.instance.reset_idle!
34
36
  end
35
37
  end
@@ -1,5 +1,5 @@
1
1
  module Capybara
2
2
  class Experience
3
- VERSION = "0.3.2"
3
+ VERSION = "0.3.4"
4
4
  end
5
5
  end
@@ -6,7 +6,11 @@ module Capybara
6
6
  class Experience
7
7
  include Capybara::DSL
8
8
 
9
- delegate :t, to: I18n if defined?(I18n)
9
+ if defined?(I18n)
10
+ def t(*arg)
11
+ I18n.t(*args)
12
+ end
13
+ end
10
14
 
11
15
  def initialize(driver_name: nil)
12
16
  @driver_name = driver_name
@@ -20,7 +24,9 @@ module Capybara
20
24
  @driver_name ||= Capybara.current_driver
21
25
  end
22
26
 
23
- delegate :driver, to: :page
27
+ def driver
28
+ page.driver
29
+ end
24
30
 
25
31
  def page
26
32
  @page ||= Experience::Pool.instance.take(driver: driver_name)
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: capybara-experience
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.2
4
+ version: 0.3.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ryan Ong
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: exe
11
11
  cert_chain: []
12
- date: 2022-09-01 00:00:00.000000000 Z
12
+ date: 2022-10-12 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: bundler
@@ -53,6 +53,20 @@ dependencies:
53
53
  - - "~>"
54
54
  - !ruby/object:Gem::Version
55
55
  version: '3.0'
56
+ - !ruby/object:Gem::Dependency
57
+ name: sinatra
58
+ requirement: !ruby/object:Gem::Requirement
59
+ requirements:
60
+ - - ">="
61
+ - !ruby/object:Gem::Version
62
+ version: 3.0.2
63
+ type: :development
64
+ prerelease: false
65
+ version_requirements: !ruby/object:Gem::Requirement
66
+ requirements:
67
+ - - ">="
68
+ - !ruby/object:Gem::Version
69
+ version: 3.0.2
56
70
  - !ruby/object:Gem::Dependency
57
71
  name: capybara
58
72
  requirement: !ruby/object:Gem::Requirement