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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 141ff12063684e2c83f94cd8d5fab2861a1da524
4
- data.tar.gz: 34ec01c10edba6adf3bd80c7e0e8b8a4644bd36e
3
+ metadata.gz: c6e4f21fff92e713c0e6b5aac414d974938dee8c
4
+ data.tar.gz: 13fe5367e023d0a37e0b69b4ef7e30abff29b739
5
5
  SHA512:
6
- metadata.gz: 7e479246ea6e28a30666dbd0016359fa091e9d0f761df95b37045652ca47c589f7eb12a5c8be80b55d8a56c42b7bfa8d136926d435c075479d96ba215305294f
7
- data.tar.gz: 9652669e2da0d3738c045511767ec5058f0afa7cafc8b3836eefb869d35d004c86043ef4c88c70631a42574e0ae8ff26bf5a5c5ff06ac888135660a627745229
6
+ metadata.gz: 747e7000f598382d1e84397d5803c1b758c6ff11fe0df618ec254efebeac0b973f118c2f8a9538b3f5b97ea89aa8693743ab5e1c34bbdedc03bbcc5310f4a204
7
+ data.tar.gz: 97bdffc137319c01031a9df0bc6c029dcdcd0fd403c8a31d13d91131d5499faaa6cbd49e8f63064290fa66a8453f3d961d32d8cf1cb4d3b8e2459033c58ee909
data/README.md CHANGED
@@ -41,7 +41,7 @@ Or install it yourself as:
41
41
  **Equivalence** expectation:
42
42
 
43
43
  ```ruby
44
- Expect.this { 'foo' }.to eql: 'foo' # => true
44
+ Expect.this { 'foo' }.not_to eql: 'bar' # => true
45
45
  ```
46
46
 
47
47
  **Identity** expectation:
data/VERSION.semver CHANGED
@@ -1 +1 @@
1
- 0.0.3
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 = `git ls-files -z`.split("\x0")
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?(false, definition, &@actual)
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
- Matcher.pass?(true, definition, &@actual)
28
+ to(definition).equal?(false)
29
29
  end
30
30
  end
31
31
  end
@@ -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?(negated, definition, &actual)
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
- negated ^ matcher.matches?(&actual)
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
@@ -8,7 +8,7 @@ module Expect
8
8
  #
9
9
  # @api public
10
10
  #
11
- # @example Duck example
11
+ # @example Identity expectation
12
12
  # this { 42 }.to equal: 42 # => true
13
13
  #
14
14
  # @return [ExpectationTarget] the expectation target.
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.3
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-12 00:00:00.000000000 Z
11
+ date: 2015-02-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: matchi