wist 0.2.7 → 0.3.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +5 -5
- data/lib/wist.rb +22 -3
- 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: 3112671f26405f4c839b28cef0a2b6f7c6eb8f48
|
4
|
+
data.tar.gz: 8a8174b542d4fd09d73d28300af07dabd8ddd999
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: cc2f1d98dea77c4025989044ba114b19d96deeda8134c130877e012497f2d0a5f3f6f864fdccba937edb13ee5eaaf434939872b8a426e8b4f18f7b7cd0fe0d58
|
7
|
+
data.tar.gz: f6003c1fd3892a3e8e0854ab1be25ac1872b70d3adbb4407cbff7d51f30a1125d2ce3c4d577308c07ce49f5b3ba0d14442c9582f72b5c3d58d70f67a07afacbb
|
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
wist (0.
|
4
|
+
wist (0.3.0)
|
5
5
|
capybara
|
6
6
|
selenium-webdriver
|
7
7
|
|
@@ -16,11 +16,11 @@ GEM
|
|
16
16
|
rack (>= 1.0.0)
|
17
17
|
rack-test (>= 0.5.4)
|
18
18
|
xpath (~> 2.0)
|
19
|
-
childprocess (0.5.
|
19
|
+
childprocess (0.5.6)
|
20
20
|
ffi (~> 1.0, >= 1.0.11)
|
21
21
|
cliver (0.3.2)
|
22
22
|
coderay (1.0.9)
|
23
|
-
ffi (1.9.
|
23
|
+
ffi (1.9.10)
|
24
24
|
method_source (0.8.2)
|
25
25
|
mime-types (2.4.3)
|
26
26
|
mini_portile (0.6.2)
|
@@ -48,13 +48,13 @@ GEM
|
|
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.46.2)
|
52
52
|
childprocess (~> 0.5)
|
53
53
|
multi_json (~> 1.0)
|
54
54
|
rubyzip (~> 1.0)
|
55
55
|
websocket (~> 1.0)
|
56
56
|
slop (3.4.6)
|
57
|
-
websocket (1.2.
|
57
|
+
websocket (1.2.2)
|
58
58
|
websocket-driver (0.4.0)
|
59
59
|
xpath (2.0.0)
|
60
60
|
nokogiri (~> 1.3)
|
data/lib/wist.rb
CHANGED
@@ -8,20 +8,39 @@ module Wist
|
|
8
8
|
end
|
9
9
|
|
10
10
|
class << self
|
11
|
-
attr_accessor(:
|
11
|
+
attr_accessor(:rspec_should)
|
12
|
+
attr_accessor(:rspec_expect)
|
13
|
+
attr_accessor(:assert_syntax_detected)
|
12
14
|
end
|
13
|
-
self.rspec = defined?(RSpec)
|
14
15
|
|
15
16
|
module Helpers
|
16
17
|
module_function
|
17
18
|
|
19
|
+
def detect_assert_syntax
|
20
|
+
return if Wist.assert_syntax_detected
|
21
|
+
|
22
|
+
if defined?(RSpec)
|
23
|
+
if RSpec.configuration.expect_with[0].configuration.syntax.include?(:expect)
|
24
|
+
Wist.rspec_expect = true
|
25
|
+
else
|
26
|
+
Wist.rspec_should = true
|
27
|
+
end
|
28
|
+
end
|
29
|
+
|
30
|
+
Wist.assert_syntax_detected = true
|
31
|
+
end
|
32
|
+
|
18
33
|
def blank?(obj)
|
19
34
|
obj.respond_to?(:empty?) ? obj.empty? : !obj
|
20
35
|
end
|
21
36
|
end
|
22
37
|
|
23
38
|
def wist_assert(value, expected)
|
24
|
-
|
39
|
+
Helpers.detect_assert_syntax
|
40
|
+
|
41
|
+
if Wist.rspec_expect
|
42
|
+
expect(value).to eq(expected)
|
43
|
+
elsif Wist.rspec_should
|
25
44
|
value.should == expected
|
26
45
|
else
|
27
46
|
assert_equal(expected, value)
|
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.3.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-07-
|
11
|
+
date: 2015-07-22 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: capybara
|