travel_to_javascript 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +11 -0
- data/.rspec +3 -0
- data/.rubocop.yml +49 -0
- data/.travis.yml +20 -0
- data/CODE_OF_CONDUCT.md +74 -0
- data/Gemfile +12 -0
- data/Gemfile.lock +98 -0
- data/LICENSE.txt +21 -0
- data/README.md +99 -0
- data/Rakefile +8 -0
- data/bin/console +15 -0
- data/bin/setup +8 -0
- data/lib/travel_to_javascript.rb +49 -0
- data/lib/travel_to_javascript/version.rb +5 -0
- data/travel_to_javascript.gemspec +31 -0
- metadata +90 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 18d4fa7a967206118bffb572e13ff639e049a37e2bc69c9588ba7c0812a2036c
|
4
|
+
data.tar.gz: 150deea5b3cb92491a87edc0a6ebff7ca45629e0baf1518baaf4a83f09223f91
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 6a4f483e314ff142f6ad09446dd12866982acadebf5f20b08439fa259c1cd26c439e0c623cd90e1b8f65748478b50577f0e9a1ecea9a3ea5f057c18711fd8c5e
|
7
|
+
data.tar.gz: d47e3d22f504178abe42e086ab16032db8ca1e49fd94cb7d97017c6f9dd1ec29e5de38a85bea311e3304c3027a3ef1626980b888fbf3a4c3ea493b8b6bce08b9
|
data/.gitignore
ADDED
data/.rspec
ADDED
data/.rubocop.yml
ADDED
@@ -0,0 +1,49 @@
|
|
1
|
+
AllCops:
|
2
|
+
TargetRubyVersion: 2.7.1
|
3
|
+
Exclude:
|
4
|
+
- 'vendor/**/*'
|
5
|
+
- 'spec/spec_helper.rb'
|
6
|
+
|
7
|
+
Lint/RaiseException:
|
8
|
+
Enabled: true
|
9
|
+
|
10
|
+
Lint/StructNewOverride:
|
11
|
+
Enabled: true
|
12
|
+
|
13
|
+
Metrics/ClassLength:
|
14
|
+
Max: 120
|
15
|
+
|
16
|
+
Metrics/MethodLength:
|
17
|
+
Exclude:
|
18
|
+
- 'test/**/*'
|
19
|
+
|
20
|
+
Metrics/AbcSize:
|
21
|
+
Exclude:
|
22
|
+
- 'test/**/*'
|
23
|
+
|
24
|
+
Metrics/BlockLength:
|
25
|
+
Exclude:
|
26
|
+
- 'spec/**/*'
|
27
|
+
|
28
|
+
Style/Documentation:
|
29
|
+
Enabled: false
|
30
|
+
|
31
|
+
Style/ParallelAssignment:
|
32
|
+
Enabled: false
|
33
|
+
|
34
|
+
Style/HashEachMethods:
|
35
|
+
Enabled: true
|
36
|
+
|
37
|
+
Style/HashTransformKeys:
|
38
|
+
Enabled: true
|
39
|
+
|
40
|
+
Style/HashTransformValues:
|
41
|
+
Enabled: true
|
42
|
+
|
43
|
+
Layout/LineLength:
|
44
|
+
Max: 90
|
45
|
+
Exclude:
|
46
|
+
- 'travel_to_javascript.gemspec'
|
47
|
+
|
48
|
+
Layout/EmptyLineAfterGuardClause:
|
49
|
+
Enabled: false
|
data/.travis.yml
ADDED
@@ -0,0 +1,20 @@
|
|
1
|
+
---
|
2
|
+
dist: trusty
|
3
|
+
language: ruby
|
4
|
+
cache: bundler
|
5
|
+
rvm:
|
6
|
+
- 2.7.1
|
7
|
+
- 2.6.6
|
8
|
+
- 2.5.8
|
9
|
+
addons:
|
10
|
+
chrome: stable
|
11
|
+
apt:
|
12
|
+
packages:
|
13
|
+
- chromium-chromedriver
|
14
|
+
before_install:
|
15
|
+
- export TZ=Asia/Tokyo
|
16
|
+
- gem install bundler -v 2.1.4
|
17
|
+
before_script:
|
18
|
+
- "export DISPLAY=:99.0"
|
19
|
+
- "sh -e /etc/init.d/xvfb start"
|
20
|
+
- sleep 3
|
data/CODE_OF_CONDUCT.md
ADDED
@@ -0,0 +1,74 @@
|
|
1
|
+
# Contributor Covenant Code of Conduct
|
2
|
+
|
3
|
+
## Our Pledge
|
4
|
+
|
5
|
+
In the interest of fostering an open and welcoming environment, we as
|
6
|
+
contributors and maintainers pledge to making participation in our project and
|
7
|
+
our community a harassment-free experience for everyone, regardless of age, body
|
8
|
+
size, disability, ethnicity, gender identity and expression, level of experience,
|
9
|
+
nationality, personal appearance, race, religion, or sexual identity and
|
10
|
+
orientation.
|
11
|
+
|
12
|
+
## Our Standards
|
13
|
+
|
14
|
+
Examples of behavior that contributes to creating a positive environment
|
15
|
+
include:
|
16
|
+
|
17
|
+
* Using welcoming and inclusive language
|
18
|
+
* Being respectful of differing viewpoints and experiences
|
19
|
+
* Gracefully accepting constructive criticism
|
20
|
+
* Focusing on what is best for the community
|
21
|
+
* Showing empathy towards other community members
|
22
|
+
|
23
|
+
Examples of unacceptable behavior by participants include:
|
24
|
+
|
25
|
+
* The use of sexualized language or imagery and unwelcome sexual attention or
|
26
|
+
advances
|
27
|
+
* Trolling, insulting/derogatory comments, and personal or political attacks
|
28
|
+
* Public or private harassment
|
29
|
+
* Publishing others' private information, such as a physical or electronic
|
30
|
+
address, without explicit permission
|
31
|
+
* Other conduct which could reasonably be considered inappropriate in a
|
32
|
+
professional setting
|
33
|
+
|
34
|
+
## Our Responsibilities
|
35
|
+
|
36
|
+
Project maintainers are responsible for clarifying the standards of acceptable
|
37
|
+
behavior and are expected to take appropriate and fair corrective action in
|
38
|
+
response to any instances of unacceptable behavior.
|
39
|
+
|
40
|
+
Project maintainers have the right and responsibility to remove, edit, or
|
41
|
+
reject comments, commits, code, wiki edits, issues, and other contributions
|
42
|
+
that are not aligned to this Code of Conduct, or to ban temporarily or
|
43
|
+
permanently any contributor for other behaviors that they deem inappropriate,
|
44
|
+
threatening, offensive, or harmful.
|
45
|
+
|
46
|
+
## Scope
|
47
|
+
|
48
|
+
This Code of Conduct applies both within project spaces and in public spaces
|
49
|
+
when an individual is representing the project or its community. Examples of
|
50
|
+
representing a project or community include using an official project e-mail
|
51
|
+
address, posting via an official social media account, or acting as an appointed
|
52
|
+
representative at an online or offline event. Representation of a project may be
|
53
|
+
further defined and clarified by project maintainers.
|
54
|
+
|
55
|
+
## Enforcement
|
56
|
+
|
57
|
+
Instances of abusive, harassing, or otherwise unacceptable behavior may be
|
58
|
+
reported by contacting the project team at madogiwa0124@gmail.com. All
|
59
|
+
complaints will be reviewed and investigated and will result in a response that
|
60
|
+
is deemed necessary and appropriate to the circumstances. The project team is
|
61
|
+
obligated to maintain confidentiality with regard to the reporter of an incident.
|
62
|
+
Further details of specific enforcement policies may be posted separately.
|
63
|
+
|
64
|
+
Project maintainers who do not follow or enforce the Code of Conduct in good
|
65
|
+
faith may face temporary or permanent repercussions as determined by other
|
66
|
+
members of the project's leadership.
|
67
|
+
|
68
|
+
## Attribution
|
69
|
+
|
70
|
+
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
|
71
|
+
available at [https://contributor-covenant.org/version/1/4][version]
|
72
|
+
|
73
|
+
[homepage]: https://contributor-covenant.org
|
74
|
+
[version]: https://contributor-covenant.org/version/1/4/
|
data/Gemfile
ADDED
data/Gemfile.lock
ADDED
@@ -0,0 +1,98 @@
|
|
1
|
+
PATH
|
2
|
+
remote: .
|
3
|
+
specs:
|
4
|
+
travel_to_javascript (0.1.0)
|
5
|
+
capybara
|
6
|
+
webdrivers (~> 4.0)
|
7
|
+
|
8
|
+
GEM
|
9
|
+
remote: https://rubygems.org/
|
10
|
+
specs:
|
11
|
+
addressable (2.7.0)
|
12
|
+
public_suffix (>= 2.0.2, < 5.0)
|
13
|
+
ast (2.4.0)
|
14
|
+
capybara (3.32.1)
|
15
|
+
addressable
|
16
|
+
mini_mime (>= 0.1.3)
|
17
|
+
nokogiri (~> 1.8)
|
18
|
+
rack (>= 1.6.0)
|
19
|
+
rack-test (>= 0.6.3)
|
20
|
+
regexp_parser (~> 1.5)
|
21
|
+
xpath (~> 3.2)
|
22
|
+
childprocess (3.0.0)
|
23
|
+
diff-lcs (1.3)
|
24
|
+
jaro_winkler (1.5.4)
|
25
|
+
mini_mime (1.0.2)
|
26
|
+
mini_portile2 (2.4.0)
|
27
|
+
minitest (5.14.0)
|
28
|
+
mustermann (1.1.1)
|
29
|
+
ruby2_keywords (~> 0.0.1)
|
30
|
+
nokogiri (1.10.9)
|
31
|
+
mini_portile2 (~> 2.4.0)
|
32
|
+
parallel (1.19.1)
|
33
|
+
parser (2.7.1.0)
|
34
|
+
ast (~> 2.4.0)
|
35
|
+
public_suffix (4.0.4)
|
36
|
+
rack (2.2.2)
|
37
|
+
rack-protection (2.0.8.1)
|
38
|
+
rack
|
39
|
+
rack-test (1.1.0)
|
40
|
+
rack (>= 1.0, < 3)
|
41
|
+
rainbow (3.0.0)
|
42
|
+
rake (12.3.3)
|
43
|
+
regexp_parser (1.7.0)
|
44
|
+
rexml (3.2.4)
|
45
|
+
rspec (3.9.0)
|
46
|
+
rspec-core (~> 3.9.0)
|
47
|
+
rspec-expectations (~> 3.9.0)
|
48
|
+
rspec-mocks (~> 3.9.0)
|
49
|
+
rspec-core (3.9.1)
|
50
|
+
rspec-support (~> 3.9.1)
|
51
|
+
rspec-expectations (3.9.1)
|
52
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
53
|
+
rspec-support (~> 3.9.0)
|
54
|
+
rspec-mocks (3.9.1)
|
55
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
56
|
+
rspec-support (~> 3.9.0)
|
57
|
+
rspec-support (3.9.2)
|
58
|
+
rubocop (0.81.0)
|
59
|
+
jaro_winkler (~> 1.5.1)
|
60
|
+
parallel (~> 1.10)
|
61
|
+
parser (>= 2.7.0.1)
|
62
|
+
rainbow (>= 2.2.2, < 4.0)
|
63
|
+
rexml
|
64
|
+
ruby-progressbar (~> 1.7)
|
65
|
+
unicode-display_width (>= 1.4.0, < 2.0)
|
66
|
+
ruby-progressbar (1.10.1)
|
67
|
+
ruby2_keywords (0.0.2)
|
68
|
+
rubyzip (2.3.0)
|
69
|
+
selenium-webdriver (3.142.7)
|
70
|
+
childprocess (>= 0.5, < 4.0)
|
71
|
+
rubyzip (>= 1.2.2)
|
72
|
+
sinatra (2.0.8.1)
|
73
|
+
mustermann (~> 1.0)
|
74
|
+
rack (~> 2.0)
|
75
|
+
rack-protection (= 2.0.8.1)
|
76
|
+
tilt (~> 2.0)
|
77
|
+
tilt (2.0.10)
|
78
|
+
unicode-display_width (1.7.0)
|
79
|
+
webdrivers (4.2.0)
|
80
|
+
nokogiri (~> 1.6)
|
81
|
+
rubyzip (>= 1.3.0)
|
82
|
+
selenium-webdriver (>= 3.0, < 4.0)
|
83
|
+
xpath (3.2.0)
|
84
|
+
nokogiri (~> 1.8)
|
85
|
+
|
86
|
+
PLATFORMS
|
87
|
+
ruby
|
88
|
+
|
89
|
+
DEPENDENCIES
|
90
|
+
minitest
|
91
|
+
rake (~> 12.0)
|
92
|
+
rspec
|
93
|
+
rubocop
|
94
|
+
sinatra
|
95
|
+
travel_to_javascript!
|
96
|
+
|
97
|
+
BUNDLED WITH
|
98
|
+
2.1.4
|
data/LICENSE.txt
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
The MIT License (MIT)
|
2
|
+
|
3
|
+
Copyright (c) 2020 Madogiwa
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
7
|
+
in the Software without restriction, including without limitation the rights
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
10
|
+
furnished to do so, subject to the following conditions:
|
11
|
+
|
12
|
+
The above copyright notice and this permission notice shall be included in
|
13
|
+
all copies or substantial portions of the Software.
|
14
|
+
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
21
|
+
THE SOFTWARE.
|
data/README.md
ADDED
@@ -0,0 +1,99 @@
|
|
1
|
+
# TravelToJavascript
|
2
|
+
|
3
|
+
This gem provides a helper `travel_to_javascript` that locks time in javascript.
|
4
|
+
It supports `rspec` and `minitest` using capybara.
|
5
|
+
|
6
|
+
Override `Date` and `Date.now` in JavaScript by args.
|
7
|
+
|
8
|
+
## Installation
|
9
|
+
|
10
|
+
Add this line to your application's Gemfile:
|
11
|
+
|
12
|
+
```ruby
|
13
|
+
gem 'travel_to_javascript'
|
14
|
+
```
|
15
|
+
|
16
|
+
And then execute:
|
17
|
+
|
18
|
+
$ bundle install
|
19
|
+
|
20
|
+
Or install it yourself as:
|
21
|
+
|
22
|
+
$ gem install travel_to_javascript
|
23
|
+
|
24
|
+
## Usage
|
25
|
+
|
26
|
+
`travel_to_javascript` can be used by include `TravelToJavascript`.
|
27
|
+
|
28
|
+
By passing the object of `Capybara::Session`(ex. `page`) and the date and time to the argument of `travel_to_javascript`, the time of JavaScript in the block can be fixed at the time of the argument.
|
29
|
+
|
30
|
+
### Rspec
|
31
|
+
|
32
|
+
``` ruby
|
33
|
+
require 'spec_helper'
|
34
|
+
require 'travel_to_javascript'
|
35
|
+
|
36
|
+
RSpec.describe 'SampleFeatureSpec', type: :feature do
|
37
|
+
include TravelToJavascript
|
38
|
+
|
39
|
+
it 'sample spec' do
|
40
|
+
# NOTE: Use a JavaScript enabled driver.
|
41
|
+
page = Capybara::Session.new(:headless_chrome, TestApp)
|
42
|
+
travel_to_javascript(page, DateTime.parse('2000-01-01 1:11:11.111+9:00')) do
|
43
|
+
page.execute_script('console.error(Date.now(), new Date())')
|
44
|
+
pp page.driver.browser.manage.logs.get(:browser).map(&:message)
|
45
|
+
# locks time by args in block.
|
46
|
+
# => ["console-api 2:32 946656671111 Sat Jan 01 2000 01:11:11 GMT+0900"]
|
47
|
+
end
|
48
|
+
page.execute_script('console.error(Date.now(), new Date())')
|
49
|
+
pp page.driver.browser.manage.logs.get(:browser).map(&:message)
|
50
|
+
# restore time outside block.
|
51
|
+
# => ["console-api 2:32 1586652460142 Sun Apr 12 2020 09:47:40 GMT+0900"]
|
52
|
+
end
|
53
|
+
end
|
54
|
+
```
|
55
|
+
|
56
|
+
### Minitest
|
57
|
+
|
58
|
+
``` ruby
|
59
|
+
require 'test_helper'
|
60
|
+
require 'travel_to_javascript'
|
61
|
+
|
62
|
+
class SampleFeatureTest < Minitest::Test
|
63
|
+
include TravelToJavascript
|
64
|
+
|
65
|
+
def test_sample
|
66
|
+
# NOTE: Use a JavaScript enabled driver.
|
67
|
+
page = Capybara::Session.new(:headless_chrome, TestApp)
|
68
|
+
travel_to_javascript(page, DateTime.parse('2000-01-01 1:11:11.111+9:00')) do
|
69
|
+
page.execute_script('console.error(Date.now(), new Date())')
|
70
|
+
pp page.driver.browser.manage.logs.get(:browser).map(&:message)
|
71
|
+
# locks time by args in block.
|
72
|
+
# => ["console-api 2:32 946656671111 Sat Jan 01 2000 01:11:11 GMT+0900"]
|
73
|
+
end
|
74
|
+
page.execute_script('console.error(Date.now(), new Date())')
|
75
|
+
pp page.driver.browser.manage.logs.get(:browser).map(&:message)
|
76
|
+
# restore time outside block.
|
77
|
+
# => ["console-api 2:32 1586652460142 Sun Apr 12 2020 09:47:40 GMT+0900"]
|
78
|
+
end
|
79
|
+
end
|
80
|
+
```
|
81
|
+
|
82
|
+
## Development
|
83
|
+
|
84
|
+
After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
|
85
|
+
|
86
|
+
To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
|
87
|
+
|
88
|
+
## Contributing
|
89
|
+
|
90
|
+
Bug reports and pull requests are welcome on GitHub at https://github.com/Madogiwa0124/travel_to_javascript. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [code of conduct](https://github.com/Madogiwa0124/travel_to_javascript/blob/master/CODE_OF_CONDUCT.md).
|
91
|
+
|
92
|
+
|
93
|
+
## License
|
94
|
+
|
95
|
+
The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
|
96
|
+
|
97
|
+
## Code of Conduct
|
98
|
+
|
99
|
+
Everyone interacting in the TravelToJavascript project's codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/Madogiwa0124/travel_to_javascript/blob/master/CODE_OF_CONDUCT.md).
|
data/Rakefile
ADDED
data/bin/console
ADDED
@@ -0,0 +1,15 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
# frozen_string_literal: true
|
3
|
+
|
4
|
+
require 'bundler/setup'
|
5
|
+
require 'travel_to_javascript'
|
6
|
+
|
7
|
+
# You can add fixtures and/or initialization code here to make experimenting
|
8
|
+
# with your gem easier. You can also use a different console, if you like.
|
9
|
+
|
10
|
+
# (If you use this, don't forget to add pry to your Gemfile!)
|
11
|
+
# require "pry"
|
12
|
+
# Pry.start
|
13
|
+
|
14
|
+
require 'irb'
|
15
|
+
IRB.start(__FILE__)
|
data/bin/setup
ADDED
@@ -0,0 +1,49 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'travel_to_javascript/version'
|
4
|
+
|
5
|
+
module TravelToJavascript
|
6
|
+
def travel_to_javascript(page, datetime)
|
7
|
+
page.execute_script time_stop_javascript(datetime)
|
8
|
+
yield
|
9
|
+
page.execute_script time_undo_javsctipt
|
10
|
+
end
|
11
|
+
|
12
|
+
private
|
13
|
+
|
14
|
+
def time_stop_javascript(rb_datetime)
|
15
|
+
<<~JS
|
16
|
+
originDate = Date;
|
17
|
+
Date = #{time_stop_js_function_for_date(rb_datetime)};
|
18
|
+
Date.now = #{time_stop_js_function_for_date_now(rb_datetime)};
|
19
|
+
JS
|
20
|
+
end
|
21
|
+
|
22
|
+
def time_undo_javsctipt
|
23
|
+
'Date = originDate;'
|
24
|
+
end
|
25
|
+
|
26
|
+
def time_stop_js_function_for_date(rb_datetime)
|
27
|
+
<<~JS
|
28
|
+
function (datetime) {
|
29
|
+
if (datetime) {
|
30
|
+
return new originDate(datetime);
|
31
|
+
} else {
|
32
|
+
return new originDate("#{rb_datetime.iso8601(6)}");
|
33
|
+
}
|
34
|
+
}
|
35
|
+
JS
|
36
|
+
end
|
37
|
+
|
38
|
+
def time_stop_js_function_for_date_now(rb_datetime)
|
39
|
+
<<~JS
|
40
|
+
function (datetime) {
|
41
|
+
if (datetime) {
|
42
|
+
return new originDate(datetime).getTime();
|
43
|
+
} else {
|
44
|
+
return new originDate("#{rb_datetime.iso8601(6)}").getTime();
|
45
|
+
}
|
46
|
+
}
|
47
|
+
JS
|
48
|
+
end
|
49
|
+
end
|
@@ -0,0 +1,31 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require_relative 'lib/travel_to_javascript/version'
|
4
|
+
|
5
|
+
Gem::Specification.new do |spec|
|
6
|
+
spec.name = 'travel_to_javascript'
|
7
|
+
spec.version = TravelToJavascript::VERSION
|
8
|
+
spec.authors = ['Madogiwa']
|
9
|
+
spec.email = ['madogiwa0124@gmail.com']
|
10
|
+
|
11
|
+
spec.summary = 'This gem provides a helper `travel_to_javascript` that locks time in javascript.'
|
12
|
+
spec.description = 'It supports rspec and minitest using capybara.Override Date and Date.now in JavaScript by args.'
|
13
|
+
spec.homepage = 'https://github.com/Madogiwa0124/travel_to_javascript'
|
14
|
+
spec.license = 'MIT'
|
15
|
+
spec.required_ruby_version = Gem::Requirement.new('>= 2.5.0')
|
16
|
+
|
17
|
+
spec.metadata['homepage_uri'] = spec.homepage
|
18
|
+
spec.metadata['source_code_uri'] = spec.homepage
|
19
|
+
spec.metadata['changelog_uri'] = spec.homepage
|
20
|
+
|
21
|
+
# Specify which files should be added to the gem when it is released.
|
22
|
+
# The `git ls-files -z` loads the files in the RubyGem that have been added into git.
|
23
|
+
spec.files = Dir.chdir(File.expand_path(__dir__)) do
|
24
|
+
`git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
|
25
|
+
end
|
26
|
+
spec.bindir = 'exe'
|
27
|
+
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
28
|
+
spec.require_paths = ['lib']
|
29
|
+
spec.add_runtime_dependency 'capybara'
|
30
|
+
spec.add_runtime_dependency 'webdrivers', '~> 4.0'
|
31
|
+
end
|
metadata
ADDED
@@ -0,0 +1,90 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: travel_to_javascript
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.1.0
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Madogiwa
|
8
|
+
autorequire:
|
9
|
+
bindir: exe
|
10
|
+
cert_chain: []
|
11
|
+
date: 2020-04-12 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: capybara
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - ">="
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '0'
|
20
|
+
type: :runtime
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - ">="
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '0'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: webdrivers
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - "~>"
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '4.0'
|
34
|
+
type: :runtime
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - "~>"
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '4.0'
|
41
|
+
description: It supports rspec and minitest using capybara.Override Date and Date.now
|
42
|
+
in JavaScript by args.
|
43
|
+
email:
|
44
|
+
- madogiwa0124@gmail.com
|
45
|
+
executables: []
|
46
|
+
extensions: []
|
47
|
+
extra_rdoc_files: []
|
48
|
+
files:
|
49
|
+
- ".gitignore"
|
50
|
+
- ".rspec"
|
51
|
+
- ".rubocop.yml"
|
52
|
+
- ".travis.yml"
|
53
|
+
- CODE_OF_CONDUCT.md
|
54
|
+
- Gemfile
|
55
|
+
- Gemfile.lock
|
56
|
+
- LICENSE.txt
|
57
|
+
- README.md
|
58
|
+
- Rakefile
|
59
|
+
- bin/console
|
60
|
+
- bin/setup
|
61
|
+
- lib/travel_to_javascript.rb
|
62
|
+
- lib/travel_to_javascript/version.rb
|
63
|
+
- travel_to_javascript.gemspec
|
64
|
+
homepage: https://github.com/Madogiwa0124/travel_to_javascript
|
65
|
+
licenses:
|
66
|
+
- MIT
|
67
|
+
metadata:
|
68
|
+
homepage_uri: https://github.com/Madogiwa0124/travel_to_javascript
|
69
|
+
source_code_uri: https://github.com/Madogiwa0124/travel_to_javascript
|
70
|
+
changelog_uri: https://github.com/Madogiwa0124/travel_to_javascript
|
71
|
+
post_install_message:
|
72
|
+
rdoc_options: []
|
73
|
+
require_paths:
|
74
|
+
- lib
|
75
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
76
|
+
requirements:
|
77
|
+
- - ">="
|
78
|
+
- !ruby/object:Gem::Version
|
79
|
+
version: 2.5.0
|
80
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
81
|
+
requirements:
|
82
|
+
- - ">="
|
83
|
+
- !ruby/object:Gem::Version
|
84
|
+
version: '0'
|
85
|
+
requirements: []
|
86
|
+
rubygems_version: 3.1.2
|
87
|
+
signing_key:
|
88
|
+
specification_version: 4
|
89
|
+
summary: This gem provides a helper `travel_to_javascript` that locks time in javascript.
|
90
|
+
test_files: []
|