expect 0.0.10 → 0.0.11

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: ffa099c977ed5d55292506e72d845fda55dc9bf7
4
- data.tar.gz: 26925a6847c0ca076c42cc65eab5d6639ece5363
3
+ metadata.gz: 7de6846baf7cc1312493683ed571e4a740b0cdcd
4
+ data.tar.gz: 01a45a776cb1d2d08694108db3792bb95692ea98
5
5
  SHA512:
6
- metadata.gz: 0e529e8db912b1fee5713f663e44217cb0aab3cd66471c8a2aa4782a07118f237c3bd65d69103bab7cff4e9746cb78fceceafaa1c04f677b6109afd14ea37c26
7
- data.tar.gz: 2138f50c1647baddc35fc928fdedba3c747a540e4edddd73d921a50f1b3d0ae2f2857d84fb88bc2be7f4ea2fc2c59a47a4c840f2dfd0a4fd9fb25345d7ebd486
6
+ metadata.gz: b9306020622f8ce7b24deadf68750834b6a80be8548d2301667ceeb6a07cca3e5c0594e0f6297ea7981365bbb4fa5a3d8c1c791adae51e7a8b129a2cb30fcf0c
7
+ data.tar.gz: 6df8893e96b4b1ed8c0d6531795a8814533327b7a45a84036f139649d56cda6d69d1ef8f626638977baf7c9bdb7e661ee1ddcc95f6f5d764cde9db7a4226b1b8
data/.gitignore CHANGED
@@ -1,4 +1,5 @@
1
1
  /.bundle/
2
+ /.ruby-version
2
3
  /.yardoc
3
4
  /Gemfile.lock
4
5
  /_yardoc/
data/README.md CHANGED
@@ -73,3 +73,7 @@ __Expect__ follows [Semantic Versioning 2.0](http://semver.org/).
73
73
  3. Commit your changes (`git commit -am 'Add some feature'`)
74
74
  4. Push to the branch (`git push origin my-new-feature`)
75
75
  5. Create a new Pull Request
76
+
77
+ ## License
78
+
79
+ See `LICENSE.md` file.
@@ -1 +1 @@
1
- 0.0.10
1
+ 0.0.11
@@ -9,15 +9,16 @@ 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").reject { |f| f.match(/^test\//) }
13
- spec.executables = spec.files.grep(/^exe\//) { |f| File.basename(f) }
12
+ spec.files =
13
+ `git ls-files -z`.split("\x0").reject { |f| f.match(/%r{^test}/) }
14
+ spec.executables = spec.files.grep(/%r{^exe}/) { |f| File.basename(f) }
14
15
  spec.require_paths = ['lib']
15
16
 
16
- spec.add_dependency 'matchi', '~> 0.0.5'
17
+ spec.add_dependency 'matchi', '~> 0.0.6'
17
18
 
18
19
  spec.add_development_dependency 'bundler', '~> 1.9'
19
20
  spec.add_development_dependency 'rake', '~> 10.4'
20
21
  spec.add_development_dependency 'yard', '~> 0.8'
21
- spec.add_development_dependency 'simplecov', '~> 0.9.2'
22
- spec.add_development_dependency 'rubocop', '~> 0.29'
22
+ spec.add_development_dependency 'simplecov', '~> 0.10'
23
+ spec.add_development_dependency 'rubocop', '~> 0.31'
23
24
  end
@@ -9,8 +9,6 @@ require_relative File.join 'expect', 'expectation_target'
9
9
  module Expect
10
10
  # Expectations are built with this method.
11
11
  #
12
- # @api public
13
- #
14
12
  # @example Identity expectation
15
13
  # this { 42 }.to Equal: 42 # => true
16
14
  #
@@ -4,8 +4,6 @@ module Expect
4
4
  # Wraps the target of an expectation. This class is responsible for reporting
5
5
  # if the expectation is true or false.
6
6
  #
7
- # @api private
8
- #
9
7
  # @example
10
8
  # ExpectationTarget.new { 42 }.to Equal: 42 # => true
11
9
  class ExpectationTarget
@@ -19,13 +17,15 @@ module Expect
19
17
  @actual = actual
20
18
  end
21
19
 
20
+ # @return [BasicObject] the object to be compared with the expected one
21
+ # though the matcher.
22
+ #
22
23
  attr_reader :actual
23
24
 
24
25
  # Evaluate to a positive assertion.
25
26
  #
26
- # @api public
27
- #
28
- # @param [Hash, Symbol] definition
27
+ # @param definition [Array, Hash, Symbol] The definition of the expected
28
+ # value.
29
29
  #
30
30
  # @return [Boolean] report if the expectation is true or false
31
31
  def to(definition)
@@ -34,20 +34,20 @@ module Expect
34
34
 
35
35
  # Evaluate to a negative assertion.
36
36
  #
37
- # @api public
37
+ # @param (see #to)
38
38
  #
39
- # @param [Hash, Symbol] definition
40
- #
41
- # @return [Boolean] report if the expectation is not true or not false
39
+ # @return (see #to)
42
40
  def not_to(definition)
43
41
  !to(definition)
44
42
  end
45
43
 
46
44
  private
47
45
 
46
+ # @api private
47
+ #
48
48
  # Load the matcher.
49
49
  #
50
- # @param [Array, Hash, Symbol] definition
50
+ # @param (see #to)
51
51
  #
52
52
  # @return [#matches?] the matcher
53
53
  def matcher(definition)
@@ -0,0 +1,3 @@
1
+ require 'simplecov'
2
+
3
+ SimpleCov.start
@@ -0,0 +1,8 @@
1
+ require_relative File.join 'support', 'coverage'
2
+ require_relative File.join '..', 'lib', 'expect'
3
+
4
+ # It is expected to be false
5
+ fail unless Expect.this { false }.to(:BeFalse)
6
+
7
+ # It is expected to not be false
8
+ fail if Expect.this { false }.not_to(:BeFalse)
@@ -0,0 +1,8 @@
1
+ require_relative File.join 'support', 'coverage'
2
+ require_relative File.join '..', 'lib', 'expect'
3
+
4
+ # It is expected to be nil
5
+ fail unless Expect.this { nil }.to(:BeNil)
6
+
7
+ # It is expected to not be nil
8
+ fail if Expect.this { nil }.not_to(:BeNil)
@@ -0,0 +1,8 @@
1
+ require_relative File.join 'support', 'coverage'
2
+ require_relative File.join '..', 'lib', 'expect'
3
+
4
+ # It is expected to be true
5
+ fail unless Expect.this { true }.to(:BeTrue)
6
+
7
+ # It is expected to not be true
8
+ fail if Expect.this { true }.not_to(:BeTrue)
@@ -0,0 +1,8 @@
1
+ require_relative File.join 'support', 'coverage'
2
+ require_relative File.join '..', 'lib', 'expect'
3
+
4
+ # It is expected to be equivalent to 'foo'
5
+ fail unless Expect.this { 'foo' }.to(Eql: 'foo')
6
+
7
+ # It is expected to not be equivalent to 'foo'
8
+ fail if Expect.this { 'foo' }.not_to(Eql: 'foo')
@@ -0,0 +1,8 @@
1
+ require_relative File.join 'support', 'coverage'
2
+ require_relative File.join '..', 'lib', 'expect'
3
+
4
+ # It is expected to identity :foo
5
+ fail unless Expect.this { :foo }.to(Equal: :foo)
6
+
7
+ # It is expected to not identity :foo
8
+ fail if Expect.this { :foo }.not_to(Equal: :foo)
@@ -0,0 +1,8 @@
1
+ require_relative File.join 'support', 'coverage'
2
+ require_relative File.join '..', 'lib', 'expect'
3
+
4
+ # It is expected to match /^foo$/
5
+ fail unless Expect.this { 'foo' }.to(Match: /^foo$/)
6
+
7
+ # It is expected to not identity :foo
8
+ fail if Expect.this { 'foo' }.not_to(Match: /^foo$/)
@@ -0,0 +1,8 @@
1
+ require_relative File.join 'support', 'coverage'
2
+ require_relative File.join '..', 'lib', 'expect'
3
+
4
+ # It is expected to raise the exception NameError
5
+ fail unless Expect.this { Boom }.to(RaiseException: NameError)
6
+
7
+ # It is expected to not raise the exception NameError
8
+ fail if Expect.this { Boom }.not_to(RaiseException: NameError)
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.10
4
+ version: 0.0.11
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-04-05 00:00:00.000000000 Z
11
+ date: 2015-05-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: matchi
@@ -16,14 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: 0.0.5
19
+ version: 0.0.6
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - "~>"
25
25
  - !ruby/object:Gem::Version
26
- version: 0.0.5
26
+ version: 0.0.6
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: bundler
29
29
  requirement: !ruby/object:Gem::Requirement
@@ -72,28 +72,28 @@ dependencies:
72
72
  requirements:
73
73
  - - "~>"
74
74
  - !ruby/object:Gem::Version
75
- version: 0.9.2
75
+ version: '0.10'
76
76
  type: :development
77
77
  prerelease: false
78
78
  version_requirements: !ruby/object:Gem::Requirement
79
79
  requirements:
80
80
  - - "~>"
81
81
  - !ruby/object:Gem::Version
82
- version: 0.9.2
82
+ version: '0.10'
83
83
  - !ruby/object:Gem::Dependency
84
84
  name: rubocop
85
85
  requirement: !ruby/object:Gem::Requirement
86
86
  requirements:
87
87
  - - "~>"
88
88
  - !ruby/object:Gem::Version
89
- version: '0.29'
89
+ version: '0.31'
90
90
  type: :development
91
91
  prerelease: false
92
92
  version_requirements: !ruby/object:Gem::Requirement
93
93
  requirements:
94
94
  - - "~>"
95
95
  - !ruby/object:Gem::Version
96
- version: '0.29'
96
+ version: '0.31'
97
97
  description: Expectation library with some matchers for Ruby.
98
98
  email:
99
99
  - contact@cyril.email
@@ -115,6 +115,14 @@ files:
115
115
  - expect.gemspec
116
116
  - lib/expect.rb
117
117
  - lib/expect/expectation_target.rb
118
+ - test/support/coverage.rb
119
+ - test/test_be_false.rb
120
+ - test/test_be_nil.rb
121
+ - test/test_be_true.rb
122
+ - test/test_eql.rb
123
+ - test/test_equal.rb
124
+ - test/test_match.rb
125
+ - test/test_raise_exception.rb
118
126
  homepage: https://github.com/fixrb/expect
119
127
  licenses:
120
128
  - MIT