wist 0.3.1 → 0.4.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile +1 -1
- data/Gemfile.lock +6 -6
- data/lib/wist.rb +16 -4
- data/test/tests/wist_test.rb +4 -4
- data/wist.gemspec +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 10cca54a428e9d773cbae796707143783b12243b
|
4
|
+
data.tar.gz: 32c6af1c6f59d2728fc5432a96733ab171aca930
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9b918cd234dfd215ff897054d2e492fec8cd4e665d4bebf385e5fda7dcc4e9c1d20c33c94256561ec785c861655393d510dd7a6ec1ee63a7e48a7630a668f6d3
|
7
|
+
data.tar.gz: ca47d1828c1a1d5754e13a593d4f9e6aa2b1d685cc6bd8a951ecf87528ca169e3b859de75a6d70f8060b9b081e0e8fb23c6d594738c8eb8b42f613876f896d9d
|
data/Gemfile
CHANGED
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
wist (0.
|
4
|
+
wist (0.4.0)
|
5
5
|
capybara
|
6
6
|
selenium-webdriver
|
7
7
|
|
@@ -10,7 +10,7 @@ GEM
|
|
10
10
|
specs:
|
11
11
|
ansi (1.5.0)
|
12
12
|
builder (3.2.2)
|
13
|
-
capybara (2.
|
13
|
+
capybara (2.5.0)
|
14
14
|
mime-types (>= 1.16)
|
15
15
|
nokogiri (>= 1.3.3)
|
16
16
|
rack (>= 1.0.0)
|
@@ -22,7 +22,7 @@ GEM
|
|
22
22
|
coderay (1.0.9)
|
23
23
|
ffi (1.9.10)
|
24
24
|
method_source (0.8.2)
|
25
|
-
mime-types (2.
|
25
|
+
mime-types (2.6.2)
|
26
26
|
mini_portile (0.6.2)
|
27
27
|
minitest (5.5.1)
|
28
28
|
minitest-reporters (1.0.11)
|
@@ -42,13 +42,13 @@ GEM
|
|
42
42
|
coderay (~> 1.0.5)
|
43
43
|
method_source (~> 0.8)
|
44
44
|
slop (~> 3.4)
|
45
|
-
rack (1.6.
|
45
|
+
rack (1.6.4)
|
46
46
|
rack-test (0.6.3)
|
47
47
|
rack (>= 1.0)
|
48
48
|
rake (10.1.0)
|
49
49
|
ruby-progressbar (1.7.1)
|
50
50
|
rubyzip (1.1.7)
|
51
|
-
selenium-webdriver (2.
|
51
|
+
selenium-webdriver (2.47.1)
|
52
52
|
childprocess (~> 0.5)
|
53
53
|
multi_json (~> 1.0)
|
54
54
|
rubyzip (~> 1.0)
|
@@ -63,7 +63,7 @@ PLATFORMS
|
|
63
63
|
ruby
|
64
64
|
|
65
65
|
DEPENDENCIES
|
66
|
-
capybara (= 2.
|
66
|
+
capybara (= 2.5.0)
|
67
67
|
minitest-reporters
|
68
68
|
poltergeist (= 1.5.1)
|
69
69
|
pry
|
data/lib/wist.rb
CHANGED
@@ -11,8 +11,16 @@ module Wist
|
|
11
11
|
attr_accessor(:rspec_should)
|
12
12
|
attr_accessor(:rspec_expect)
|
13
13
|
attr_accessor(:assert_syntax_detected)
|
14
|
+
attr_accessor(:wait_time_method)
|
14
15
|
end
|
15
16
|
|
17
|
+
self.wait_time_method = if defined?(Capybara.default_max_wait_time)
|
18
|
+
:default_max_wait_time
|
19
|
+
else
|
20
|
+
:default_wait_time
|
21
|
+
end
|
22
|
+
|
23
|
+
|
16
24
|
module Helpers
|
17
25
|
module_function
|
18
26
|
|
@@ -217,19 +225,23 @@ module Wist
|
|
217
225
|
do_instantly { has_css?(*args) }
|
218
226
|
end
|
219
227
|
|
228
|
+
def get_capybara_wait_time
|
229
|
+
Capybara.public_send(Wist.wait_time_method)
|
230
|
+
end
|
231
|
+
|
220
232
|
def do_instantly
|
221
233
|
lambda do
|
222
|
-
|
223
|
-
@old_wait_time =
|
234
|
+
default_max_wait_time = get_capybara_wait_time
|
235
|
+
@old_wait_time = default_max_wait_time if default_max_wait_time > 0
|
224
236
|
end.()
|
225
|
-
Capybara.
|
237
|
+
Capybara.public_send("#{Wist.wait_time_method}=", 0)
|
226
238
|
|
227
239
|
begin
|
228
240
|
yield
|
229
241
|
rescue => e
|
230
242
|
raise(e)
|
231
243
|
ensure
|
232
|
-
Capybara.
|
244
|
+
Capybara.public_send("#{Wist.wait_time_method}=", @old_wait_time)
|
233
245
|
end
|
234
246
|
end
|
235
247
|
|
data/test/tests/wist_test.rb
CHANGED
@@ -39,7 +39,7 @@ class WistTest < CapybaraTestCase
|
|
39
39
|
|
40
40
|
wait_until(&wait_until_test(button))
|
41
41
|
# make sure default wait time is back to normal
|
42
|
-
assert_equal(2,
|
42
|
+
assert_equal(2, get_capybara_wait_time)
|
43
43
|
end
|
44
44
|
|
45
45
|
def test_verify_tweet_button
|
@@ -193,19 +193,19 @@ class WistTest < CapybaraTestCase
|
|
193
193
|
end
|
194
194
|
|
195
195
|
def test_do_instantly
|
196
|
-
old_time =
|
196
|
+
old_time = get_capybara_wait_time
|
197
197
|
new_time = nil
|
198
198
|
|
199
199
|
begin
|
200
200
|
do_instantly do
|
201
|
-
new_time =
|
201
|
+
new_time = get_capybara_wait_time
|
202
202
|
raise
|
203
203
|
end
|
204
204
|
rescue
|
205
205
|
end
|
206
206
|
|
207
207
|
assert_equal(0, new_time)
|
208
|
-
assert_equal(old_time,
|
208
|
+
assert_equal(old_time, get_capybara_wait_time)
|
209
209
|
end
|
210
210
|
|
211
211
|
def test_interact_with_confirm
|
data/wist.gemspec
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: wist
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.4.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Lihan Li
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-
|
11
|
+
date: 2015-10-07 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: capybara
|