look_like 0.3.2 → 0.3.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 +18 -16
- data/lib/look_like/support.rb +0 -4
- data/lib/look_like/version.rb +1 -1
- data/look_like.gemspec +1 -2
- metadata +3 -5
- data/CODE_OF_CONDUCT.md +0 -3
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: cf6ec5fab460f769c398b0cc1733ddcfec476894
|
|
4
|
+
data.tar.gz: b35d8e87e4c6b0d851b34816d5a131d540fc8c74
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 580b102df188795e8937a5d919570cb25e484a850713af185eaaf04c6e54a71a171eafdffb3e20b80cd9249a3d7e20cd8bf9360081e4cca84e79fe6acb18693c
|
|
7
|
+
data.tar.gz: ee83bac170ee26dc7363c4fe8d25491f58e92c6a6b069b156d449a088d8d19563f4bd8ccdce07b495e23d1d5234f52bb4e91a821dfee5c3b8c6690fc5d274cb5
|
data/README.md
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
# look_like matcher [](https://travis-ci.org/nishants/look_like) [](https://coveralls.io/github/nishants/look_like) [](https://badge.fury.io/rb/look_like)
|
|
1
|
+
# look_like matcher [](https://travis-ci.org/nishants/look_like) [](https://coveralls.io/github/nishants/look_like?branch=master) [](https://badge.fury.io/rb/look_like)
|
|
2
2
|
|
|
3
3
|
- This gem is a collection of rspec matchers, for writing wireframe tests.
|
|
4
4
|
- Such tests search for visual clues for detecting presence of a bug.
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
- These can reuse your code for regression tests.
|
|
7
7
|
- Meaningful assertion reports help in quick diagnosis of faults.
|
|
8
8
|
- For example you can write test for fresh deployments to make sure the currency and language are correct by domain/user.
|
|
9
|
-
- [Try online] (http://amoeba.social/lab/
|
|
9
|
+
- [Try online] (http://amoeba.social/lab/look-like/)
|
|
10
10
|
|
|
11
11
|
## Installation
|
|
12
12
|
|
|
@@ -37,7 +37,7 @@ expected = [["email", "₹amount", "yes/no*"]]
|
|
|
37
37
|
expect(actual).to look_like(expected)
|
|
38
38
|
```
|
|
39
39
|
|
|
40
|
-
[Try online here](http://localhost:3001/2.0/lab/
|
|
40
|
+
[Try online here](http://localhost:3001/2.0/lab/look-like/index.html#/Rows)
|
|
41
41
|
## Custom Matchers
|
|
42
42
|
```ruby
|
|
43
43
|
|
|
@@ -81,13 +81,13 @@ end
|
|
|
81
81
|
```
|
|
82
82
|
|
|
83
83
|
## List of Matchers
|
|
84
|
-
- [**Email**] (http://amoeba.social/lab/
|
|
84
|
+
- [**Email**] (http://amoeba.social/lab/look-like/#/Email)
|
|
85
85
|
```ruby
|
|
86
86
|
expect("one@two.xyz").to look_like("email")
|
|
87
87
|
expect("one@two.xyz").to look_like("a@b.com")
|
|
88
88
|
```
|
|
89
89
|
|
|
90
|
-
- [**Amount and Currency**](http://amoeba.social/lab/
|
|
90
|
+
- [**Amount and Currency**](http://amoeba.social/lab/look-like/#/Amount%20and%20Currency)
|
|
91
91
|
```ruby
|
|
92
92
|
expect("$53,23,1").to look_like("$amount")
|
|
93
93
|
expect("₹23,1.00").to look_like("₹amount")
|
|
@@ -96,26 +96,27 @@ expect("$53,23,1").to look_like("$12.21")
|
|
|
96
96
|
expect("₹23,1.00").to look_like("₹100.12")
|
|
97
97
|
```
|
|
98
98
|
|
|
99
|
-
- [**Enums**](http://amoeba.social/lab/
|
|
99
|
+
- [**Enums**](http://amoeba.social/lab/look-like/#/Enums)
|
|
100
100
|
```ruby
|
|
101
101
|
expect("one").to look_like("one/two/three")
|
|
102
102
|
expect("four").not_to look_like("one/two/three")
|
|
103
103
|
```
|
|
104
104
|
|
|
105
|
-
- [**Regex**](http://amoeba.social/lab/
|
|
105
|
+
- [**Regex**](http://amoeba.social/lab/look-like/#/Regex)
|
|
106
106
|
```ruby
|
|
107
|
-
expect("
|
|
108
|
-
expect("
|
|
107
|
+
expect("1-12-1-2").to look_like("/[\\d\\-]+/")
|
|
108
|
+
expect("$3.67").to look_like("/\\$(?<dollars>\\d+)\\.(?<cents>\\d+)/")
|
|
109
|
+
expect("$367").not_to look_like("/\\$(?<dollars>\\d+)\\.(?<cents>\\d+)/")
|
|
109
110
|
```
|
|
110
111
|
|
|
111
|
-
- [**URL**](http://amoeba.social/lab/
|
|
112
|
+
- [**URL**](http://amoeba.social/lab/look-like/#/URL)
|
|
112
113
|
```ruby
|
|
113
114
|
expect("google.com").to look_like("http://google.com")
|
|
114
115
|
expect("http://google.com").to look_like("http://google.com")
|
|
115
116
|
expect("google-com").not_to look_like("http://google.com")
|
|
116
117
|
```
|
|
117
118
|
|
|
118
|
-
- [**Wildcard**](http://amoeba.social/lab/
|
|
119
|
+
- [**Wildcard**](http://amoeba.social/lab/look-like/#/Wildcard)
|
|
119
120
|
```ruby
|
|
120
121
|
expect("").to look_like("email*")
|
|
121
122
|
expect("not.an.email").not_to look_like("email*")
|
|
@@ -127,7 +128,7 @@ expect("").to look_like("*")
|
|
|
127
128
|
expect("any-thing").to look_like("*")
|
|
128
129
|
```
|
|
129
130
|
|
|
130
|
-
- [**Numbers**](http://amoeba.social/lab/
|
|
131
|
+
- [**Numbers**](http://amoeba.social/lab/look-like/#/Numbers)
|
|
131
132
|
```ruby
|
|
132
133
|
expect("5000").to look_like("number")
|
|
133
134
|
expect("5,000").to look_like("number")
|
|
@@ -138,7 +139,7 @@ expect("5000").to look_like("5,000")
|
|
|
138
139
|
expect("$5000").not_to look_like("5000")
|
|
139
140
|
```
|
|
140
141
|
|
|
141
|
-
- [**Date and Time**](http://amoeba.social/lab/
|
|
142
|
+
- [**Date and Time**](http://amoeba.social/lab/look-like/#/Date%20and%20Time)
|
|
142
143
|
```ruby
|
|
143
144
|
expect("12/13/2014").to look_like("date")
|
|
144
145
|
expect("12/13/2014").to look_like("DD/MM/YYYY")
|
|
@@ -147,17 +148,18 @@ expect("06/21/1987").to look_like("12/13/2014")
|
|
|
147
148
|
expect("1994-11-05T08:15:30-05:00").to look_like("timestamp")
|
|
148
149
|
expect("2014-12-31 T 11:59:13").to look_like("YYYY-MM-DD T HH:MM:SS")
|
|
149
150
|
expect("2014-12-31 T 11:59:13").to look_like("YYYY-MM-DD T hh:mm:ss")
|
|
150
|
-
expect("1994-11-05T08:15:30-05:00").to look_like("
|
|
151
|
+
expect("1994-11-05T08:15:30-05:00").to look_like("2011-02-05T18:23:30-05:00")
|
|
152
|
+
|
|
151
153
|
```
|
|
152
154
|
|
|
153
|
-
- [**Arrays**](http://amoeba.social/lab/
|
|
155
|
+
- [**Arrays**](http://amoeba.social/lab/look-like/index.html#/Arrays)
|
|
154
156
|
```ruby
|
|
155
157
|
actual = ["one@two.xyz", "₹300,20", ""]
|
|
156
158
|
expected = ["email" , "₹amount" , "*"]
|
|
157
159
|
expect(actual).to look_like(expected)
|
|
158
160
|
```
|
|
159
161
|
|
|
160
|
-
- [**Rows**](http://amoeba.social/lab/
|
|
162
|
+
- [**Rows**](http://amoeba.social/lab/look-like/index.html#/Rows)
|
|
161
163
|
```ruby
|
|
162
164
|
actual = [["one@two.xyz" , "₹300,20", "yes"],
|
|
163
165
|
["two@three.com", "₹301,20", "no" ],
|
data/lib/look_like/support.rb
CHANGED
|
@@ -10,10 +10,6 @@ module LookLike
|
|
|
10
10
|
!!(string =~ /\A#{URI::regexp}\z/)
|
|
11
11
|
end
|
|
12
12
|
|
|
13
|
-
def self.amount_def?(string)
|
|
14
|
-
rounded = string.sub(".", ",").strip
|
|
15
|
-
/^\$[\s]*[\d,]+\d$/ === rounded
|
|
16
|
-
end
|
|
17
13
|
def self.amount?(string)
|
|
18
14
|
rounded = string.sub(".", ",").strip
|
|
19
15
|
/^\$[\s]*[\d,]+\d$/ === rounded
|
data/lib/look_like/version.rb
CHANGED
data/look_like.gemspec
CHANGED
|
@@ -10,8 +10,7 @@ Gem::Specification.new do |spec|
|
|
|
10
10
|
spec.email = ["nishant.singh87@gmail.com"]
|
|
11
11
|
|
|
12
12
|
spec.summary = "an rspec matcher for comparing visually similar strings"
|
|
13
|
-
spec.
|
|
14
|
-
spec.homepage = "http://amoeba.social"
|
|
13
|
+
spec.homepage = "http://amoeba.social/lab/look-like/"
|
|
15
14
|
spec.license = "MIT"
|
|
16
15
|
|
|
17
16
|
spec.files = `git ls-files -z`.split("\x0").reject do |f|
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: look_like
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.3.
|
|
4
|
+
version: 0.3.3
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- nishant
|
|
@@ -52,8 +52,7 @@ dependencies:
|
|
|
52
52
|
- - "~>"
|
|
53
53
|
- !ruby/object:Gem::Version
|
|
54
54
|
version: '3.0'
|
|
55
|
-
description:
|
|
56
|
-
long paragraph with words'') '
|
|
55
|
+
description:
|
|
57
56
|
email:
|
|
58
57
|
- nishant.singh87@gmail.com
|
|
59
58
|
executables: []
|
|
@@ -63,7 +62,6 @@ files:
|
|
|
63
62
|
- ".gitignore"
|
|
64
63
|
- ".rspec"
|
|
65
64
|
- ".travis.yml"
|
|
66
|
-
- CODE_OF_CONDUCT.md
|
|
67
65
|
- Gemfile
|
|
68
66
|
- LICENSE.txt
|
|
69
67
|
- README.md
|
|
@@ -90,7 +88,7 @@ files:
|
|
|
90
88
|
- lib/look_like/support.rb
|
|
91
89
|
- lib/look_like/version.rb
|
|
92
90
|
- look_like.gemspec
|
|
93
|
-
homepage: http://amoeba.social
|
|
91
|
+
homepage: http://amoeba.social/lab/look-like/
|
|
94
92
|
licenses:
|
|
95
93
|
- MIT
|
|
96
94
|
metadata: {}
|
data/CODE_OF_CONDUCT.md
DELETED