masque 0.2.0 → 0.2.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +8 -0
- data/Gemfile +2 -0
- data/README.md +3 -0
- data/lib/masque/dsl.rb +14 -0
- data/lib/masque/version.rb +1 -1
- data/spec/spec_helper.rb +3 -0
- data/spec/support/driver.rb +19 -0
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5ce74176f64dc03dce4b0789c2dad179fd2b4674
|
4
|
+
data.tar.gz: 6f591a6e12e9895f433f59f3d2e823af94d21a51
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6fa6ac963be6a889b0fd3dd852b7fc42fc78698518227294b1fb5b1f99d18fac0678e2f66811b558afa98dd10d9067a4222ff5ca4e961ebf12fcda1091f34788
|
7
|
+
data.tar.gz: f5db900a1fef41084923f4cd7d10cab59f49ad21a20d921ec01597e682410d7b33c303bc6227191d59dfdb202d0fd85297dafd3d3889658e7da21eaf98208d57
|
data/.travis.yml
ADDED
data/Gemfile
CHANGED
data/README.md
CHANGED
@@ -1,3 +1,6 @@
|
|
1
|
+
[![Build Status](https://travis-ci.org/uu59/masque.png?branch=master)](https://travis-ci.org/uu59/masque)
|
2
|
+
[![Coverage Status](https://coveralls.io/repos/uu59/masque/badge.png?branch=master)](https://coveralls.io/r/uu59/masque)
|
3
|
+
|
1
4
|
# Masque
|
2
5
|
|
3
6
|
<a href="http://ja.wikipedia.org/wiki/%E3%83%95%E3%82%A1%E3%82%A4%E3%83%AB:Noh_mask02.jpg"><img src="http://upload.wikimedia.org/wikipedia/commons/b/bd/Noh_mask02.jpg" alt="女面" /></a>
|
data/lib/masque/dsl.rb
CHANGED
@@ -1,5 +1,7 @@
|
|
1
1
|
# -- coding: utf-8
|
2
2
|
|
3
|
+
require "timeout"
|
4
|
+
|
3
5
|
class Masque
|
4
6
|
module DSL
|
5
7
|
def save_screenshot(path)
|
@@ -54,5 +56,17 @@ class Masque
|
|
54
56
|
end
|
55
57
|
alias :resize_window :resize
|
56
58
|
|
59
|
+
def wait_until(timeout = nil, &block)
|
60
|
+
timeout ||= 5
|
61
|
+
start = Time.now
|
62
|
+
ret = nil
|
63
|
+
loop do
|
64
|
+
break if ret = yield
|
65
|
+
sleep 0.01
|
66
|
+
raise TimeoutError if (Time.now - start) > timeout
|
67
|
+
end
|
68
|
+
ret
|
69
|
+
end
|
70
|
+
|
57
71
|
end
|
58
72
|
end
|
data/lib/masque/version.rb
CHANGED
data/spec/spec_helper.rb
CHANGED
data/spec/support/driver.rb
CHANGED
@@ -68,6 +68,25 @@ shared_examples_for "driver" do
|
|
68
68
|
end
|
69
69
|
body.should_not be_nil
|
70
70
|
end
|
71
|
+
|
72
|
+
describe "#wait_until" do
|
73
|
+
it "return block value" do
|
74
|
+
masque.run do
|
75
|
+
wait_until do
|
76
|
+
"hi"
|
77
|
+
end.should == "hi"
|
78
|
+
end
|
79
|
+
end
|
80
|
+
|
81
|
+
it "raise TimeoutError when timeout" do
|
82
|
+
expect do
|
83
|
+
masque.run do
|
84
|
+
wait_until(0.01) do
|
85
|
+
end
|
86
|
+
end
|
87
|
+
end.to raise_error(TimeoutError)
|
88
|
+
end
|
89
|
+
end
|
71
90
|
end
|
72
91
|
|
73
92
|
it "#reset_session!" do
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: masque
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- uu59
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-03-
|
11
|
+
date: 2013-03-30 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: headless
|
@@ -130,6 +130,7 @@ extensions: []
|
|
130
130
|
extra_rdoc_files: []
|
131
131
|
files:
|
132
132
|
- .gitignore
|
133
|
+
- .travis.yml
|
133
134
|
- Gemfile
|
134
135
|
- LICENSE.txt
|
135
136
|
- README.md
|