still_life 0.1.0 → 0.2.0

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: e8dc100759230e82f493b0bae7e3c6fc600f854ef6ff77a858037e92a662aaa7
4
- data.tar.gz: f432cd88652963f9ffa70a249aa1554d3d0ce37ab5742d84538bcaebdca185e7
3
+ metadata.gz: 92d2486c2d3db425af9db4c7b0632a5aecadd94ea383e13c51e3e9f0fab1f70f
4
+ data.tar.gz: 6b8193f48947fec6d8d4bc079582614669ac171b9d87af6bd1c7abc188830469
5
5
  SHA512:
6
- metadata.gz: 9cdcef43678b79532a812b2bd4d9006ad63fd75b27ed28ddf606bd7ff20e77f1860fb1dd3e13be8dd2f297d4ef140b4eaa7f69b2adf60f3e7c72c02ee6afb725
7
- data.tar.gz: 812976cf80fa3b687dd11a3bafcc4642462544019726ad61fd96dc5ed9110724f6ef886b6d3016b09ea9bc35360c866c8ea4c5d60e365056168e1f4e64df8b48
6
+ metadata.gz: 4c09f261b346364ffb7c0c5e487ae97295cb75cfad7de6f7707cbab45e86ae7b4f210d6656d2e74c221e0a4efaf3396af3b7a5f0db39e7ba139b3aa9ab6e14ab
7
+ data.tar.gz: b05f324577658154e7c60f1d35b5d919e39ba87a985273056e03197e13733a862361727fa963eb5bd6b2d7691704452e4e722f21c3883f462857a99f7073340f
data/.gitignore CHANGED
@@ -12,3 +12,4 @@ log/
12
12
  *.sqlite3
13
13
  /test/dummy_app/tmp/cache/
14
14
  /test/dummy_app/tmp/html/
15
+ /test/dummy_app/tmp/development_secret.txt
@@ -1,7 +1,18 @@
1
- ---
2
- sudo: false
1
+ dist: focal
3
2
  language: ruby
4
3
  cache: bundler
4
+
5
+ addons:
6
+ chrome: stable
7
+
8
+ before_install:
9
+ - sudo apt update -qq
10
+ - sudo apt install -y chromium-chromedriver
11
+
5
12
  rvm:
6
- - 2.7.0
7
- before_install: gem install bundler -v 2.0.1
13
+ - 2.7.2
14
+
15
+ env:
16
+ - TEST_FRAMEWORK=test-unit
17
+ - TEST_FRAMEWORK=minitest
18
+ - TEST_FRAMEWORK=rspec
data/README.md CHANGED
@@ -122,20 +122,24 @@ and push some more commits...
122
122
  ### 4. Compare the results, and make sure there's no unexpected diffs
123
123
 
124
124
  ```sh
125
- % diff -r tmp/html/rails52 tmp/html/rails60
125
+ % git diff --no-index --color-words tmp/html/rails52/ tmp/html/rails60/
126
126
  ```
127
127
 
128
128
 
129
129
  ## Notes
130
+ ### git diff
131
+ As written in the above example, `git diff --no-index --color-words` should perfectly work for recursively comparing two output directories.
132
+
130
133
  ### Random Values
131
134
 
132
135
  If your response includes some kind of random values, the test results may change between each test runs.
133
- In such case, maybe you could specify a random seed, or mock the random source in your app, or `grep -v` is always your friend.
136
+ In such case, maybe you could specify a random seed, or mock the random source in your app.
134
137
 
135
138
 
136
139
  ## TODOs / Known Issues
137
140
  - The Capybara monkeypatch sometimes fails to get the `page.body` due to Capybara timing problem
138
141
  - Support older versions of Rails, Capybara, and Ruby
142
+ - Fix the CI with RSpec + headless Chrome
139
143
 
140
144
 
141
145
  ## Contributing
data/Rakefile CHANGED
@@ -7,6 +7,8 @@ Rake::TestTask.new(:test) do |t|
7
7
  t.libs << "test"
8
8
  t.libs << "lib"
9
9
  t.test_files = FileList['test/**/*_test.rb'] - FileList['test/dummy_app/test/**/*_test.rb']
10
+ t.warning = true
11
+ t.verbose = true
10
12
  end
11
13
 
12
14
  task default: :test
@@ -2,32 +2,32 @@
2
2
 
3
3
  module StillLife
4
4
  module ActionDispatchExtension
5
- def get(*args)
6
- super(*args).tap do
5
+ def get(*, **)
6
+ super.tap do
7
7
  StillLife.draw(response.body)
8
8
  end
9
9
  end
10
10
 
11
- def post(*args)
12
- super(*args).tap do
11
+ def post(*, **)
12
+ super.tap do
13
13
  StillLife.draw(response.body)
14
14
  end
15
15
  end
16
16
 
17
- def put(*args)
18
- super(*args).tap do
17
+ def put(*, **)
18
+ super.tap do
19
19
  StillLife.draw(response.body)
20
20
  end
21
21
  end
22
22
 
23
- def patch(*args)
24
- super(*args).tap do
23
+ def patch(*, **)
24
+ super.tap do
25
25
  StillLife.draw(response.body)
26
26
  end
27
27
  end
28
28
 
29
- def delete(*args)
30
- super(*args).tap do
29
+ def delete(*, **)
30
+ super.tap do
31
31
  StillLife.draw(response.body)
32
32
  end
33
33
  end
@@ -8,9 +8,12 @@ module StillLife
8
8
 
9
9
  body_was = session.body
10
10
  super.tap do
11
- session.find('body')
12
- if session.body.present? && (session.body != body_was)
13
- StillLife.draw(session.body)
11
+ 3.times do
12
+ if session.body.present? && (session.body != body_was)
13
+ StillLife.draw(session.body)
14
+ else
15
+ sleep(0.5) && next
16
+ end
14
17
  end
15
18
  end
16
19
  end
@@ -13,16 +13,19 @@ module StillLife
13
13
  ActionDispatch::SystemTestCase.include StillLife::CapybaraExtension
14
14
  end
15
15
 
16
- begin
17
- require 'rspec-rails'
16
+ ActiveSupport.on_load :active_support_test_case do
17
+ begin
18
+ require 'rspec-rails'
18
19
 
19
- #TODO maybe we could use some kind of hook instead of directly configuring here?
20
- RSpec.configure do |config|
21
- # config.prepend StillLife::ActionDispatchExtension, type: :request
22
- config.prepend StillLife::ActionDispatchExtension, type: :controller
23
- config.include StillLife::CapybaraExtension, type: :feature
20
+ # TODO: maybe we could use some kind of hook instead of directly configuring here?
21
+ RSpec.configure do |config|
22
+ config.prepend StillLife::ActionDispatchExtension, type: :request
23
+ config.prepend StillLife::ActionDispatchExtension, type: :controller
24
+ config.include StillLife::CapybaraExtension, type: :feature
25
+ config.include StillLife::CapybaraExtension, type: :system
26
+ end
27
+ rescue LoadError
24
28
  end
25
- rescue LoadError
26
29
  end
27
30
  end
28
31
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module StillLife
4
- VERSION = '0.1.0'
4
+ VERSION = '0.2.0'
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: still_life
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Akira Matsuda
8
- autorequire:
8
+ autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2019-03-19 00:00:00.000000000 Z
11
+ date: 2020-10-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -91,7 +91,7 @@ homepage: https://github.com/amatsuda/still_life
91
91
  licenses:
92
92
  - MIT
93
93
  metadata: {}
94
- post_install_message:
94
+ post_install_message:
95
95
  rdoc_options: []
96
96
  require_paths:
97
97
  - lib
@@ -106,8 +106,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
106
106
  - !ruby/object:Gem::Version
107
107
  version: '0'
108
108
  requirements: []
109
- rubygems_version: 3.0.3
110
- signing_key:
109
+ rubygems_version: 3.2.0.rc.1
110
+ signing_key:
111
111
  specification_version: 4
112
112
  summary: Test result HTML recorder
113
113
  test_files: []