expect 0.0.8 → 0.0.9
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 +4 -4
- data/VERSION.semver +1 -1
- data/lib/expect.rb +2 -2
- data/lib/expect/expectation_target.rb +1 -1
- data/lib/expect/matcher.rb +1 -2
- 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: 7390ce50fc4637aebceecbab541c3fc6d4625a46
|
4
|
+
data.tar.gz: 8e3b891f69b01d01354bf3550ac4d5ef63f618d7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ea5940e683012a0972f82aef6e124d79bfb890cfdffeddacc861888ba048bf8415b74f78138b4942d0b6bebcb740155e1c29d3d23dceb6248afebe6ef6607e44
|
7
|
+
data.tar.gz: dff2a2e61bfbc4af5ec08a903283a975cdf4c475def48126a5db23a1527da4be472aefe1bbad4aeb4d861afd75cf99901bace01ea960ef2ef10b5a7e71dfa56e
|
data/README.md
CHANGED
@@ -41,25 +41,25 @@ Or install it yourself as:
|
|
41
41
|
**Equivalence** expectation:
|
42
42
|
|
43
43
|
```ruby
|
44
|
-
Expect.this { 'foo' }.not_to
|
44
|
+
Expect.this { 'foo' }.not_to Eql: 'bar' # => true
|
45
45
|
```
|
46
46
|
|
47
47
|
**Identity** expectation:
|
48
48
|
|
49
49
|
```ruby
|
50
|
-
Expect.this { :foo }.to
|
50
|
+
Expect.this { :foo }.to Equal: :foo # => true
|
51
51
|
```
|
52
52
|
|
53
53
|
**Regular expressions** expectation:
|
54
54
|
|
55
55
|
```ruby
|
56
|
-
Expect.this { 'foo' }.to
|
56
|
+
Expect.this { 'foo' }.to Match: /^foo$/ # => true
|
57
57
|
```
|
58
58
|
|
59
59
|
**Expecting errors** expectation:
|
60
60
|
|
61
61
|
```ruby
|
62
|
-
Expect.this { Boom }.to
|
62
|
+
Expect.this { Boom }.to RaiseException: NameError # => true
|
63
63
|
```
|
64
64
|
|
65
65
|
## Versioning
|
data/VERSION.semver
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.0.
|
1
|
+
0.0.9
|
data/lib/expect.rb
CHANGED
@@ -5,14 +5,14 @@ require_relative File.join 'expect', 'expectation_target'
|
|
5
5
|
# @api public
|
6
6
|
#
|
7
7
|
# @example Expect 42 to be equal to 42
|
8
|
-
# Expect.this { 42 }.to
|
8
|
+
# Expect.this { 42 }.to Equal: 42 # => true
|
9
9
|
module Expect
|
10
10
|
# Expectations are built with this method.
|
11
11
|
#
|
12
12
|
# @api public
|
13
13
|
#
|
14
14
|
# @example Identity expectation
|
15
|
-
# this { 42 }.to
|
15
|
+
# this { 42 }.to Equal: 42 # => true
|
16
16
|
#
|
17
17
|
# @return [ExpectationTarget] the expectation target.
|
18
18
|
def self.this(&input)
|
data/lib/expect/matcher.rb
CHANGED
@@ -10,8 +10,7 @@ module Expect
|
|
10
10
|
# @return [Boolean] report if the expectation is true or false
|
11
11
|
def self.pass?(definition, &actual)
|
12
12
|
params = Array(definition).flatten(1)
|
13
|
-
|
14
|
-
matcher = Matchi.fetch(name, *params[1..-1])
|
13
|
+
matcher = Matchi.fetch(params.first, *params[1..-1])
|
15
14
|
|
16
15
|
matcher.matches?(&actual)
|
17
16
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: expect
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.9
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Cyril Wack
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-03-
|
11
|
+
date: 2015-03-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: matchi
|