local_time 1.0.2 → 1.0.3
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 +4 -4
- data/README.md +11 -0
- data/app/assets/javascripts/local_time.js.coffee +20 -1
- data/test/javascripts/fixtures/body.html +8 -0
- data/test/javascripts/{local_time → src}/local_time_test.js.coffee +0 -0
- data/test/javascripts/{local_time → src}/page_events_test.js.coffee +0 -0
- data/test/javascripts/{local_time → src}/public_api_test.js.coffee +0 -0
- data/test/javascripts/{local_time → src}/relative_date_test.js.coffee +0 -0
- data/test/javascripts/{local_time → src}/strftime_test.js.coffee +1 -2
- data/test/javascripts/{local_time/index.js.coffee → src/test.js.coffee} +2 -4
- data/test/javascripts/{local_time → src}/time_ago_test.js.coffee +0 -0
- metadata +47 -27
- data/test/javascripts/runner/config.ru +0 -19
- data/test/javascripts/runner/index.html +0 -20
- data/test/javascripts/vendor/qunit.css +0 -244
- data/test/javascripts/vendor/qunit.js +0 -2212
- data/test/javascripts/vendor/run-qunit.coffee +0 -50
@@ -1,50 +0,0 @@
|
|
1
|
-
fs = require 'fs'
|
2
|
-
print = (s) -> fs.write "/dev/stderr", s, 'w'
|
3
|
-
|
4
|
-
page = new WebPage()
|
5
|
-
page.onConsoleMessage = (msg) -> console.error msg
|
6
|
-
|
7
|
-
timeoutId = null
|
8
|
-
deferTimeout = ->
|
9
|
-
clearTimeout timeoutId if timeoutId
|
10
|
-
timeoutId = setTimeout ->
|
11
|
-
console.error "Timeout"
|
12
|
-
phantom.exit 1
|
13
|
-
, 3000
|
14
|
-
|
15
|
-
console.log "Local time: #{new Date}"
|
16
|
-
|
17
|
-
page.open phantom.args[0], ->
|
18
|
-
deferTimeout()
|
19
|
-
|
20
|
-
setInterval ->
|
21
|
-
tests = page.evaluate ->
|
22
|
-
tests = document.getElementById('qunit-tests').children
|
23
|
-
for test in tests when test.className isnt 'running' and not test.recorded
|
24
|
-
test.recorded = true
|
25
|
-
if test.className is 'pass'
|
26
|
-
'.'
|
27
|
-
else if test.className is 'fail'
|
28
|
-
'F'
|
29
|
-
|
30
|
-
for test in tests when test
|
31
|
-
deferTimeout()
|
32
|
-
print test
|
33
|
-
|
34
|
-
result = page.evaluate ->
|
35
|
-
result = document.getElementById('qunit-testresult')
|
36
|
-
tests = document.getElementById('qunit-tests').children
|
37
|
-
|
38
|
-
if result.innerText.match /completed/
|
39
|
-
console.error ""
|
40
|
-
|
41
|
-
for test in tests when test.className is 'fail'
|
42
|
-
console.error test.innerText
|
43
|
-
|
44
|
-
console.error result.innerText
|
45
|
-
return parseInt result.getElementsByClassName('failed')[0].innerText
|
46
|
-
|
47
|
-
return
|
48
|
-
|
49
|
-
phantom.exit result if result?
|
50
|
-
, 100
|