capybara-chromedriver-logger 0.1.1 → 0.1.2

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
  SHA1:
3
- metadata.gz: 7d5a174f66988c3503e4a5f220b4f9a6eaa24887
4
- data.tar.gz: 4143540fd25045dffbd3f9382d0d64301f3d458c
3
+ metadata.gz: 6bf949569140cd895d2e29fb9c168b933a362c71
4
+ data.tar.gz: 932cc9b2c08c52af54a05728428ac100621024d6
5
5
  SHA512:
6
- metadata.gz: f2c213dd1157a8ccbfa1a3250570b2913bfb3c03b6be0b112160528cd546a6c9a5204a69513fb3974eb5a33462e6789dc121d138a7c7973a21803efeb015aea9
7
- data.tar.gz: aa11beb439cc23c91058592d5d2a00983e9a91b74f3958c6b3590e650a2fd27870feb9f7b155edc38f9e5776525c1b0fba8fa5e8be8a5c6f5db0a32055184929
6
+ metadata.gz: 77de57767e12fcac2eade8c81795e1e413bbdcb6ab169696f6a1b18d3c786e83542f66ceae06c1b92cb44f7d4064e15383e8ecc5dc38ae3727ab29f07f42c968
7
+ data.tar.gz: 8edc993525de574405a2cb840956281040f8f9689de0d84d7439a072d1edc86bb781abe3313ebb9f50ed854222bcba9c35ae74fad79e8f1262f5779d801cabcf
@@ -1,3 +1,7 @@
1
+ # 0.1.2 [Feb 16, 2018]
2
+
3
+ * Use a new instance with each spec example to avoid issues with code reloading
4
+
1
5
  # 0.1.1 [Feb 16, 2018]
2
6
 
3
7
  * Added better multi-line formatting for "\n" literals
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- capybara-chromedriver-logger (0.1.1)
4
+ capybara-chromedriver-logger (0.1.2)
5
5
  capybara
6
6
  colorize
7
7
  net-http-persistent
@@ -5,18 +5,14 @@ module Capybara
5
5
  def self.for_rspec!
6
6
  ::RSpec.configure do |config|
7
7
  filters = { type: :feature }
8
- watcher = Capybara::Chromedriver::Logger::Watcher.instance
9
-
10
- config.before :suite do
11
- watcher.before_suite!
12
- end
13
8
 
14
9
  config.before :each, filters do
15
- watcher.before_example!
10
+ @_log_watcher = Capybara::Chromedriver::Logger::Watcher.new
11
+ @_log_watcher.before_example!
16
12
  end
17
13
 
18
14
  config.after :each, filters do
19
- watcher.after_example!
15
+ @_log_watcher.after_example!
20
16
  end
21
17
  end
22
18
  end
@@ -1,7 +1,7 @@
1
1
  module Capybara
2
2
  module Chromedriver
3
3
  module Logger
4
- VERSION = "0.1.1"
4
+ VERSION = "0.1.2"
5
5
  end
6
6
  end
7
7
  end
@@ -4,10 +4,6 @@ module Capybara
4
4
  module Chromedriver
5
5
  module Logger
6
6
  class Watcher
7
- def self.instance
8
- @instance ||= new
9
- end
10
-
11
7
  def initialize(log_destination: $stdout, filters: nil)
12
8
  @log_destination = log_destination
13
9
  @last_timestamp = 0
@@ -18,17 +14,9 @@ module Capybara
18
14
  @errors = []
19
15
  end
20
16
 
21
- def before_suite!
22
- @thread = Thread.new do
23
- loop do
24
- flush_logs! unless paused?
25
- sleep 0.1
26
- end
27
- end
28
- end
29
-
30
17
  def before_example!
31
18
  unpause!
19
+ start_listener!
32
20
  end
33
21
 
34
22
  def after_example!
@@ -43,6 +31,15 @@ module Capybara
43
31
 
44
32
  private
45
33
 
34
+ def start_listener!
35
+ @thread = Thread.new do
36
+ loop do
37
+ flush_logs! unless paused?
38
+ sleep 0.1
39
+ end
40
+ end
41
+ end
42
+
46
43
  def raise_errors_if_needed!
47
44
  return unless Capybara::Chromedriver::Logger.raise_js_errors?
48
45
  return if errors.empty?
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: capybara-chromedriver-logger
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - David Balatero