expect 0.0.3 → 0.0.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +1 -1
- data/VERSION.semver +1 -1
- data/expect.gemspec +1 -2
- data/lib/expect/expectation_target.rb +2 -2
- data/lib/expect/matcher.rb +2 -3
- data/lib/expect.rb +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: c6e4f21fff92e713c0e6b5aac414d974938dee8c
|
4
|
+
data.tar.gz: 13fe5367e023d0a37e0b69b4ef7e30abff29b739
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 747e7000f598382d1e84397d5803c1b758c6ff11fe0df618ec254efebeac0b973f118c2f8a9538b3f5b97ea89aa8693743ab5e1c34bbdedc03bbcc5310f4a204
|
7
|
+
data.tar.gz: 97bdffc137319c01031a9df0bc6c029dcdcd0fd403c8a31d13d91131d5499faaa6cbd49e8f63064290fa66a8453f3d961d32d8cf1cb4d3b8e2459033c58ee909
|
data/README.md
CHANGED
data/VERSION.semver
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.0.
|
1
|
+
0.0.4
|
data/expect.gemspec
CHANGED
@@ -9,8 +9,7 @@ Gem::Specification.new do |spec|
|
|
9
9
|
spec.homepage = 'https://github.com/fixrb/expect'
|
10
10
|
spec.license = 'MIT'
|
11
11
|
|
12
|
-
spec.files
|
13
|
-
.reject { |f| f.match(/^test\//) }
|
12
|
+
spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(/^test\//) }
|
14
13
|
spec.executables = spec.files.grep(/^exe\//) { |f| File.basename(f) }
|
15
14
|
spec.require_paths = ['lib']
|
16
15
|
|
@@ -16,7 +16,7 @@ module Expect
|
|
16
16
|
#
|
17
17
|
# @see Matcher#pass?
|
18
18
|
def to(definition)
|
19
|
-
Matcher.pass?(
|
19
|
+
Matcher.pass?(definition, &@actual)
|
20
20
|
end
|
21
21
|
|
22
22
|
# Evaluate to a negative assertion.
|
@@ -25,7 +25,7 @@ module Expect
|
|
25
25
|
#
|
26
26
|
# @see Matcher#pass?
|
27
27
|
def not_to(definition)
|
28
|
-
|
28
|
+
to(definition).equal?(false)
|
29
29
|
end
|
30
30
|
end
|
31
31
|
end
|
data/lib/expect/matcher.rb
CHANGED
@@ -5,17 +5,16 @@ module Expect
|
|
5
5
|
module Matcher
|
6
6
|
# Evaluate the expectation with the passed block.
|
7
7
|
#
|
8
|
-
# @param [Boolean] negated
|
9
8
|
# @param [Hash] definition
|
10
9
|
#
|
11
10
|
# @return [Boolean] Report if the expectation is true or false.
|
12
|
-
def self.pass?(
|
11
|
+
def self.pass?(definition, &actual)
|
13
12
|
params = Array(definition).flatten 1
|
14
13
|
name = params.first
|
15
14
|
expected_args = params[1..-1]
|
16
15
|
matcher = get(name).new(*expected_args)
|
17
16
|
|
18
|
-
|
17
|
+
matcher.matches?(&actual)
|
19
18
|
end
|
20
19
|
|
21
20
|
# Get the class of a matcher from its symbol.
|
data/lib/expect.rb
CHANGED
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.4
|
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-02-
|
11
|
+
date: 2015-02-14 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: matchi
|