hyper-spec 0.1.0 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +2 -7
- data/Gemfile.lock +16 -27
- data/README.md +0 -5
- data/hyper-spec.gemspec +45 -49
- data/lib/hyper-spec.rb +252 -54
- data/lib/hyper-spec/component_helpers.rb +368 -0
- data/lib/hyper-spec/{rails/engine.rb → engine.rb} +0 -1
- data/lib/hyper-spec/time_cop.rb +99 -30
- data/lib/hyper-spec/version.rb +1 -1
- data/play.rb +0 -0
- data/vendor/assets/javascripts/time_cop.rb +10 -7
- metadata +77 -98
- data/.rubocop.yml +0 -107
- data/lib/hyper-spec/component_test_helpers.rb +0 -306
- data/lib/hyper-spec/lolex.rb +0 -66
- data/lib/hyper-spec/wait_for_ajax.rb +0 -30
- data/lib/react/isomorphic_helpers.rb +0 -7
- data/lib/react/top_level_rails_component.rb +0 -104
- data/lib/selenium/web_driver/firefox/profile.rb +0 -55
data/lib/hyper-spec/version.rb
CHANGED
data/play.rb
ADDED
File without changes
|
@@ -38,6 +38,7 @@ if RUBY_ENGINE == 'opal'
|
|
38
38
|
mock_elapsed_time = mock_clock - @mock_start_time
|
39
39
|
|
40
40
|
ticks = real_elapsed_time * @scale - mock_elapsed_time
|
41
|
+
#puts "ticking... #{real_clock}: #{Time.now} + #{ticks / 1000} = #{Time.now + ticks/1000}"
|
41
42
|
|
42
43
|
`#{@lolex}.tick(#{ticks.to_i})`
|
43
44
|
nil
|
@@ -52,22 +53,21 @@ if RUBY_ENGINE == 'opal'
|
|
52
53
|
#{@resolution}
|
53
54
|
)
|
54
55
|
}
|
55
|
-
ticker
|
56
|
+
return ticker
|
56
57
|
end
|
57
58
|
|
58
59
|
def update_lolex(time, scale, resolution)
|
60
|
+
#puts "update_lolex(#{time}, #{scale}, #{resolution}) time.to_f: #{(time.to_f*1000)}"
|
59
61
|
`#{@lolex}.uninstall()` && return if scale.nil?
|
60
62
|
@mock_start_time = time.to_f * 1000
|
61
|
-
|
62
63
|
if @lolex
|
63
64
|
`#{@lolex}['_clearInterval'].call(window, #{@ticker})` if @ticker
|
64
65
|
@real_start_time = `(new #{@lolex}['_Date']).getTime()`
|
65
|
-
`#{@lolex}.tick(#{@mock_start_time
|
66
|
+
`#{@lolex}.tick(#{@mock_start_time-Time.now.to_f * 1000})`
|
66
67
|
else
|
67
68
|
@real_start_time = Time.now.to_f * 1000
|
68
69
|
@lolex = `lolex.install(window, #{@mock_start_time})`
|
69
70
|
end
|
70
|
-
|
71
71
|
@scale = scale
|
72
72
|
@resolution = resolution
|
73
73
|
@ticker = create_ticker
|
@@ -77,8 +77,6 @@ if RUBY_ENGINE == 'opal'
|
|
77
77
|
end
|
78
78
|
|
79
79
|
else
|
80
|
-
require 'timecop'
|
81
|
-
|
82
80
|
# Interface to the Lolex package running on the client side
|
83
81
|
# Below we will monkey patch Timecop to call these methods
|
84
82
|
class Lolex
|
@@ -140,14 +138,19 @@ else
|
|
140
138
|
|
141
139
|
def run_pending_evaluations
|
142
140
|
return if pending_evaluations.empty?
|
143
|
-
@capybara_page.evaluate_ruby(pending_evaluations.collect
|
141
|
+
@capybara_page.evaluate_ruby(pending_evaluations.collect do |block|
|
142
|
+
block.call
|
143
|
+
end.join("\n"))
|
144
144
|
@pending_evaluations ||= []
|
145
145
|
end
|
146
146
|
end
|
147
147
|
end
|
148
148
|
|
149
|
+
require 'timecop'
|
150
|
+
|
149
151
|
# Monkey patches to call our Lolex interface
|
150
152
|
class Timecop
|
153
|
+
|
151
154
|
private
|
152
155
|
|
153
156
|
def travel(mock_type, *args, &block)
|
metadata
CHANGED
@@ -1,15 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: hyper-spec
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- catmando
|
8
|
-
- adamcreekroad
|
9
8
|
autorequire:
|
10
9
|
bindir: exe
|
11
10
|
cert_chain: []
|
12
|
-
date: 2017-
|
11
|
+
date: 2017-03-22 00:00:00.000000000 Z
|
13
12
|
dependencies:
|
14
13
|
- !ruby/object:Gem::Dependency
|
15
14
|
name: bundler
|
@@ -25,6 +24,20 @@ dependencies:
|
|
25
24
|
- - "~>"
|
26
25
|
- !ruby/object:Gem::Version
|
27
26
|
version: '1.12'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: rake
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - "~>"
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '10.0'
|
34
|
+
type: :development
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - "~>"
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '10.0'
|
28
41
|
- !ruby/object:Gem::Dependency
|
29
42
|
name: hyper-react
|
30
43
|
requirement: !ruby/object:Gem::Requirement
|
@@ -32,13 +45,27 @@ dependencies:
|
|
32
45
|
- - ">="
|
33
46
|
- !ruby/object:Gem::Version
|
34
47
|
version: 0.10.0
|
35
|
-
type: :
|
48
|
+
type: :runtime
|
36
49
|
prerelease: false
|
37
50
|
version_requirements: !ruby/object:Gem::Requirement
|
38
51
|
requirements:
|
39
52
|
- - ">="
|
40
53
|
- !ruby/object:Gem::Version
|
41
54
|
version: 0.10.0
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: rspec-rails
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - ">="
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '0'
|
62
|
+
type: :development
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - ">="
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: '0'
|
42
69
|
- !ruby/object:Gem::Dependency
|
43
70
|
name: rails
|
44
71
|
requirement: !ruby/object:Gem::Requirement
|
@@ -54,35 +81,35 @@ dependencies:
|
|
54
81
|
- !ruby/object:Gem::Version
|
55
82
|
version: 5.0.0
|
56
83
|
- !ruby/object:Gem::Dependency
|
57
|
-
name:
|
84
|
+
name: react-rails
|
58
85
|
requirement: !ruby/object:Gem::Requirement
|
59
86
|
requirements:
|
60
87
|
- - "~>"
|
61
88
|
- !ruby/object:Gem::Version
|
62
|
-
version:
|
89
|
+
version: 1.4.0
|
63
90
|
type: :development
|
64
91
|
prerelease: false
|
65
92
|
version_requirements: !ruby/object:Gem::Requirement
|
66
93
|
requirements:
|
67
94
|
- - "~>"
|
68
95
|
- !ruby/object:Gem::Version
|
69
|
-
version:
|
96
|
+
version: 1.4.0
|
70
97
|
- !ruby/object:Gem::Dependency
|
71
|
-
name:
|
98
|
+
name: opal-rails
|
72
99
|
requirement: !ruby/object:Gem::Requirement
|
73
100
|
requirements:
|
74
|
-
- - "
|
101
|
+
- - ">="
|
75
102
|
- !ruby/object:Gem::Version
|
76
|
-
version:
|
103
|
+
version: '0'
|
77
104
|
type: :development
|
78
105
|
prerelease: false
|
79
106
|
version_requirements: !ruby/object:Gem::Requirement
|
80
107
|
requirements:
|
81
|
-
- - "
|
108
|
+
- - ">="
|
82
109
|
- !ruby/object:Gem::Version
|
83
|
-
version:
|
110
|
+
version: '0'
|
84
111
|
- !ruby/object:Gem::Dependency
|
85
|
-
name:
|
112
|
+
name: puma
|
86
113
|
requirement: !ruby/object:Gem::Requirement
|
87
114
|
requirements:
|
88
115
|
- - ">="
|
@@ -110,13 +137,13 @@ dependencies:
|
|
110
137
|
- !ruby/object:Gem::Version
|
111
138
|
version: 0.12.2
|
112
139
|
- !ruby/object:Gem::Dependency
|
113
|
-
name:
|
140
|
+
name: rspec-mocks
|
114
141
|
requirement: !ruby/object:Gem::Requirement
|
115
142
|
requirements:
|
116
143
|
- - ">="
|
117
144
|
- !ruby/object:Gem::Version
|
118
145
|
version: '0'
|
119
|
-
type: :
|
146
|
+
type: :development
|
120
147
|
prerelease: false
|
121
148
|
version_requirements: !ruby/object:Gem::Requirement
|
122
149
|
requirements:
|
@@ -124,13 +151,13 @@ dependencies:
|
|
124
151
|
- !ruby/object:Gem::Version
|
125
152
|
version: '0'
|
126
153
|
- !ruby/object:Gem::Dependency
|
127
|
-
name:
|
154
|
+
name: rspec-expectations
|
128
155
|
requirement: !ruby/object:Gem::Requirement
|
129
156
|
requirements:
|
130
157
|
- - ">="
|
131
158
|
- !ruby/object:Gem::Version
|
132
159
|
version: '0'
|
133
|
-
type: :
|
160
|
+
type: :development
|
134
161
|
prerelease: false
|
135
162
|
version_requirements: !ruby/object:Gem::Requirement
|
136
163
|
requirements:
|
@@ -138,13 +165,13 @@ dependencies:
|
|
138
165
|
- !ruby/object:Gem::Version
|
139
166
|
version: '0'
|
140
167
|
- !ruby/object:Gem::Dependency
|
141
|
-
name:
|
168
|
+
name: shoulda
|
142
169
|
requirement: !ruby/object:Gem::Requirement
|
143
170
|
requirements:
|
144
171
|
- - ">="
|
145
172
|
- !ruby/object:Gem::Version
|
146
173
|
version: '0'
|
147
|
-
type: :
|
174
|
+
type: :development
|
148
175
|
prerelease: false
|
149
176
|
version_requirements: !ruby/object:Gem::Requirement
|
150
177
|
requirements:
|
@@ -152,13 +179,13 @@ dependencies:
|
|
152
179
|
- !ruby/object:Gem::Version
|
153
180
|
version: '0'
|
154
181
|
- !ruby/object:Gem::Dependency
|
155
|
-
name:
|
182
|
+
name: shoulda-matchers
|
156
183
|
requirement: !ruby/object:Gem::Requirement
|
157
184
|
requirements:
|
158
185
|
- - ">="
|
159
186
|
- !ruby/object:Gem::Version
|
160
187
|
version: '0'
|
161
|
-
type: :
|
188
|
+
type: :development
|
162
189
|
prerelease: false
|
163
190
|
version_requirements: !ruby/object:Gem::Requirement
|
164
191
|
requirements:
|
@@ -166,13 +193,13 @@ dependencies:
|
|
166
193
|
- !ruby/object:Gem::Version
|
167
194
|
version: '0'
|
168
195
|
- !ruby/object:Gem::Dependency
|
169
|
-
name:
|
196
|
+
name: rspec-its
|
170
197
|
requirement: !ruby/object:Gem::Requirement
|
171
198
|
requirements:
|
172
199
|
- - ">="
|
173
200
|
- !ruby/object:Gem::Version
|
174
201
|
version: '0'
|
175
|
-
type: :
|
202
|
+
type: :development
|
176
203
|
prerelease: false
|
177
204
|
version_requirements: !ruby/object:Gem::Requirement
|
178
205
|
requirements:
|
@@ -180,13 +207,13 @@ dependencies:
|
|
180
207
|
- !ruby/object:Gem::Version
|
181
208
|
version: '0'
|
182
209
|
- !ruby/object:Gem::Dependency
|
183
|
-
name: rspec-
|
210
|
+
name: rspec-collection_matchers
|
184
211
|
requirement: !ruby/object:Gem::Requirement
|
185
212
|
requirements:
|
186
213
|
- - ">="
|
187
214
|
- !ruby/object:Gem::Version
|
188
215
|
version: '0'
|
189
|
-
type: :
|
216
|
+
type: :development
|
190
217
|
prerelease: false
|
191
218
|
version_requirements: !ruby/object:Gem::Requirement
|
192
219
|
requirements:
|
@@ -194,27 +221,13 @@ dependencies:
|
|
194
221
|
- !ruby/object:Gem::Version
|
195
222
|
version: '0'
|
196
223
|
- !ruby/object:Gem::Dependency
|
197
|
-
name:
|
198
|
-
requirement: !ruby/object:Gem::Requirement
|
199
|
-
requirements:
|
200
|
-
- - '='
|
201
|
-
- !ruby/object:Gem::Version
|
202
|
-
version: 2.53.4
|
203
|
-
type: :runtime
|
204
|
-
prerelease: false
|
205
|
-
version_requirements: !ruby/object:Gem::Requirement
|
206
|
-
requirements:
|
207
|
-
- - '='
|
208
|
-
- !ruby/object:Gem::Version
|
209
|
-
version: 2.53.4
|
210
|
-
- !ruby/object:Gem::Dependency
|
211
|
-
name: timecop
|
224
|
+
name: capybara
|
212
225
|
requirement: !ruby/object:Gem::Requirement
|
213
226
|
requirements:
|
214
227
|
- - ">="
|
215
228
|
- !ruby/object:Gem::Version
|
216
229
|
version: '0'
|
217
|
-
type: :
|
230
|
+
type: :development
|
218
231
|
prerelease: false
|
219
232
|
version_requirements: !ruby/object:Gem::Requirement
|
220
233
|
requirements:
|
@@ -222,35 +235,21 @@ dependencies:
|
|
222
235
|
- !ruby/object:Gem::Version
|
223
236
|
version: '0'
|
224
237
|
- !ruby/object:Gem::Dependency
|
225
|
-
name:
|
238
|
+
name: selenium-webdriver
|
226
239
|
requirement: !ruby/object:Gem::Requirement
|
227
240
|
requirements:
|
228
241
|
- - '='
|
229
242
|
- !ruby/object:Gem::Version
|
230
|
-
version:
|
231
|
-
type: :runtime
|
232
|
-
prerelease: false
|
233
|
-
version_requirements: !ruby/object:Gem::Requirement
|
234
|
-
requirements:
|
235
|
-
- - '='
|
236
|
-
- !ruby/object:Gem::Version
|
237
|
-
version: 0.2.5
|
238
|
-
- !ruby/object:Gem::Dependency
|
239
|
-
name: chromedriver-helper
|
240
|
-
requirement: !ruby/object:Gem::Requirement
|
241
|
-
requirements:
|
242
|
-
- - ">="
|
243
|
-
- !ruby/object:Gem::Version
|
244
|
-
version: '0'
|
243
|
+
version: 2.53.4
|
245
244
|
type: :development
|
246
245
|
prerelease: false
|
247
246
|
version_requirements: !ruby/object:Gem::Requirement
|
248
247
|
requirements:
|
249
|
-
- -
|
248
|
+
- - '='
|
250
249
|
- !ruby/object:Gem::Version
|
251
|
-
version:
|
250
|
+
version: 2.53.4
|
252
251
|
- !ruby/object:Gem::Dependency
|
253
|
-
name:
|
252
|
+
name: poltergeist
|
254
253
|
requirement: !ruby/object:Gem::Requirement
|
255
254
|
requirements:
|
256
255
|
- - ">="
|
@@ -264,7 +263,7 @@ dependencies:
|
|
264
263
|
- !ruby/object:Gem::Version
|
265
264
|
version: '0'
|
266
265
|
- !ruby/object:Gem::Dependency
|
267
|
-
name:
|
266
|
+
name: spring-commands-rspec
|
268
267
|
requirement: !ruby/object:Gem::Requirement
|
269
268
|
requirements:
|
270
269
|
- - ">="
|
@@ -278,7 +277,7 @@ dependencies:
|
|
278
277
|
- !ruby/object:Gem::Version
|
279
278
|
version: '0'
|
280
279
|
- !ruby/object:Gem::Dependency
|
281
|
-
name:
|
280
|
+
name: chromedriver-helper
|
282
281
|
requirement: !ruby/object:Gem::Requirement
|
283
282
|
requirements:
|
284
283
|
- - ">="
|
@@ -292,7 +291,7 @@ dependencies:
|
|
292
291
|
- !ruby/object:Gem::Version
|
293
292
|
version: '0'
|
294
293
|
- !ruby/object:Gem::Dependency
|
295
|
-
name:
|
294
|
+
name: parser
|
296
295
|
requirement: !ruby/object:Gem::Requirement
|
297
296
|
requirements:
|
298
297
|
- - ">="
|
@@ -306,21 +305,21 @@ dependencies:
|
|
306
305
|
- !ruby/object:Gem::Version
|
307
306
|
version: '0'
|
308
307
|
- !ruby/object:Gem::Dependency
|
309
|
-
name:
|
308
|
+
name: unparser
|
310
309
|
requirement: !ruby/object:Gem::Requirement
|
311
310
|
requirements:
|
312
|
-
- -
|
311
|
+
- - '='
|
313
312
|
- !ruby/object:Gem::Version
|
314
|
-
version:
|
313
|
+
version: 0.2.5
|
315
314
|
type: :development
|
316
315
|
prerelease: false
|
317
316
|
version_requirements: !ruby/object:Gem::Requirement
|
318
317
|
requirements:
|
319
|
-
- -
|
318
|
+
- - '='
|
320
319
|
- !ruby/object:Gem::Version
|
321
|
-
version:
|
320
|
+
version: 0.2.5
|
322
321
|
- !ruby/object:Gem::Dependency
|
323
|
-
name:
|
322
|
+
name: pry
|
324
323
|
requirement: !ruby/object:Gem::Requirement
|
325
324
|
requirements:
|
326
325
|
- - ">="
|
@@ -334,7 +333,7 @@ dependencies:
|
|
334
333
|
- !ruby/object:Gem::Version
|
335
334
|
version: '0'
|
336
335
|
- !ruby/object:Gem::Dependency
|
337
|
-
name:
|
336
|
+
name: method_source
|
338
337
|
requirement: !ruby/object:Gem::Requirement
|
339
338
|
requirements:
|
340
339
|
- - ">="
|
@@ -348,7 +347,7 @@ dependencies:
|
|
348
347
|
- !ruby/object:Gem::Version
|
349
348
|
version: '0'
|
350
349
|
- !ruby/object:Gem::Dependency
|
351
|
-
name:
|
350
|
+
name: opal-browser
|
352
351
|
requirement: !ruby/object:Gem::Requirement
|
353
352
|
requirements:
|
354
353
|
- - ">="
|
@@ -376,27 +375,13 @@ dependencies:
|
|
376
375
|
- !ruby/object:Gem::Version
|
377
376
|
version: '0'
|
378
377
|
- !ruby/object:Gem::Dependency
|
379
|
-
name:
|
380
|
-
requirement: !ruby/object:Gem::Requirement
|
381
|
-
requirements:
|
382
|
-
- - ">="
|
383
|
-
- !ruby/object:Gem::Version
|
384
|
-
version: '0'
|
385
|
-
type: :development
|
386
|
-
prerelease: false
|
387
|
-
version_requirements: !ruby/object:Gem::Requirement
|
388
|
-
requirements:
|
389
|
-
- - ">="
|
390
|
-
- !ruby/object:Gem::Version
|
391
|
-
version: '0'
|
392
|
-
- !ruby/object:Gem::Dependency
|
393
|
-
name: shoulda-matchers
|
378
|
+
name: rails
|
394
379
|
requirement: !ruby/object:Gem::Requirement
|
395
380
|
requirements:
|
396
381
|
- - ">="
|
397
382
|
- !ruby/object:Gem::Version
|
398
383
|
version: '0'
|
399
|
-
type: :
|
384
|
+
type: :runtime
|
400
385
|
prerelease: false
|
401
386
|
version_requirements: !ruby/object:Gem::Requirement
|
402
387
|
requirements:
|
@@ -404,7 +389,7 @@ dependencies:
|
|
404
389
|
- !ruby/object:Gem::Version
|
405
390
|
version: '0'
|
406
391
|
- !ruby/object:Gem::Dependency
|
407
|
-
name:
|
392
|
+
name: timecop
|
408
393
|
requirement: !ruby/object:Gem::Requirement
|
409
394
|
requirements:
|
410
395
|
- - ">="
|
@@ -427,7 +412,6 @@ extensions: []
|
|
427
412
|
extra_rdoc_files: []
|
428
413
|
files:
|
429
414
|
- ".gitignore"
|
430
|
-
- ".rubocop.yml"
|
431
415
|
- CODE_OF_CONDUCT.md
|
432
416
|
- Gemfile
|
433
417
|
- Gemfile.lock
|
@@ -439,22 +423,17 @@ files:
|
|
439
423
|
- hyper-spec.gemspec
|
440
424
|
- lib/bin/firebug-2.0.13-fx.xpi
|
441
425
|
- lib/hyper-spec.rb
|
442
|
-
- lib/hyper-spec/
|
443
|
-
- lib/hyper-spec/
|
444
|
-
- lib/hyper-spec/rails/engine.rb
|
426
|
+
- lib/hyper-spec/component_helpers.rb
|
427
|
+
- lib/hyper-spec/engine.rb
|
445
428
|
- lib/hyper-spec/time_cop.rb
|
446
429
|
- lib/hyper-spec/version.rb
|
447
|
-
-
|
448
|
-
- lib/react/isomorphic_helpers.rb
|
449
|
-
- lib/react/top_level_rails_component.rb
|
450
|
-
- lib/selenium/web_driver/firefox/profile.rb
|
430
|
+
- play.rb
|
451
431
|
- vendor/assets/javascripts/lolex.js
|
452
432
|
- vendor/assets/javascripts/time_cop.rb
|
453
433
|
homepage: https://github.com/ruby-hyperloop/hyper-spec
|
454
434
|
licenses:
|
455
435
|
- MIT
|
456
|
-
metadata:
|
457
|
-
allowed_push_host: https://rubygems.org
|
436
|
+
metadata: {}
|
458
437
|
post_install_message:
|
459
438
|
rdoc_options: []
|
460
439
|
require_paths:
|