matchi 0.0.3 → 0.0.4

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.
data/Gemfile CHANGED
@@ -1,5 +1,3 @@
1
1
  source 'https://rubygems.org'
2
2
 
3
3
  gemspec
4
-
5
- gem 'rubysl-irb' if RUBY_ENGINE.eql?('rbx')
data/VERSION.semver CHANGED
@@ -1 +1 @@
1
- 0.0.3
1
+ 0.0.4
data/lib/matchi.rb CHANGED
@@ -1,13 +1,7 @@
1
- require_relative File.join 'matchi', 'eql'
2
- require_relative File.join 'matchi', 'equal'
3
- require_relative File.join 'matchi', 'match'
4
- require_relative File.join 'matchi', 'raise_exception'
5
- require_relative File.join 'matchi', 'be_true'
6
- require_relative File.join 'matchi', 'be_false'
7
- require_relative File.join 'matchi', 'be_nil'
1
+ Dir[File.join File.dirname(__FILE__), 'matchi', '*.rb'].each do |fname|
2
+ require_relative fname
3
+ end
8
4
 
9
5
  # Namespace for the Matchi library.
10
- #
11
- # @api private
12
6
  module Matchi
13
7
  end
data/lib/matchi/eql.rb CHANGED
@@ -1,6 +1,12 @@
1
1
  module Matchi
2
2
  # **Equivalence** matcher.
3
3
  class Eql < BasicObject
4
+ # Initialize the matcher with an object.
5
+ #
6
+ # @example The string 'foo' matcher
7
+ # Matchi::Eql.new('foo')
8
+ #
9
+ # @param [#eql?] expected an expected equivalent object
4
10
  def initialize(expected)
5
11
  @expected = expected
6
12
  end
data/lib/matchi/equal.rb CHANGED
@@ -1,6 +1,12 @@
1
1
  module Matchi
2
2
  # **Identity** matcher.
3
3
  class Equal < BasicObject
4
+ # Initialize the matcher with an object.
5
+ #
6
+ # @example The number 42 matcher
7
+ # Matchi::Equal.new(42)
8
+ #
9
+ # @param [#equal?] expected an expected object
4
10
  def initialize(expected)
5
11
  @expected = expected
6
12
  end
data/lib/matchi/match.rb CHANGED
@@ -1,6 +1,12 @@
1
1
  module Matchi
2
2
  # **Regular expressions** matcher.
3
3
  class Match < BasicObject
4
+ # Initialize the matcher with an instance of Regexp.
5
+ #
6
+ # @example Username matcher
7
+ # Matchi::Match.new(/^[a-z0-9_-]{3,16}$/)
8
+ #
9
+ # @param [#match] expected a regular expression
4
10
  def initialize(expected)
5
11
  @expected = expected
6
12
  end
@@ -1,6 +1,12 @@
1
1
  module Matchi
2
2
  # **Expecting errors** matcher.
3
3
  class RaiseException < BasicObject
4
+ # Initialize the matcher with a descendant of class Exception.
5
+ #
6
+ # @example Divided by 0 matcher
7
+ # Matchi::RaiseException.new(ZeroDivisionError)
8
+ #
9
+ # @param [.exception] expected the class of the expected exception
4
10
  def initialize(expected)
5
11
  @expected = expected
6
12
  end
metadata CHANGED
@@ -1,83 +1,94 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: matchi
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.3
4
+ version: 0.0.4
5
+ prerelease:
5
6
  platform: ruby
6
7
  authors:
7
8
  - Cyril Wack
8
9
  autorequire:
9
10
  bindir: bin
10
11
  cert_chain: []
11
- date: 2015-02-14 00:00:00.000000000 Z
12
+ date: 2015-02-21 00:00:00.000000000 Z
12
13
  dependencies:
13
14
  - !ruby/object:Gem::Dependency
14
- type: :development
15
15
  name: bundler
16
- version_requirements: !ruby/object:Gem::Requirement
16
+ requirement: !ruby/object:Gem::Requirement
17
+ none: false
17
18
  requirements:
18
- - - "~>"
19
+ - - ~>
19
20
  - !ruby/object:Gem::Version
20
21
  version: '1.8'
22
+ type: :development
21
23
  prerelease: false
22
- requirement: !ruby/object:Gem::Requirement
24
+ version_requirements: !ruby/object:Gem::Requirement
25
+ none: false
23
26
  requirements:
24
- - - "~>"
27
+ - - ~>
25
28
  - !ruby/object:Gem::Version
26
29
  version: '1.8'
27
30
  - !ruby/object:Gem::Dependency
28
- type: :development
29
31
  name: rake
30
- version_requirements: !ruby/object:Gem::Requirement
32
+ requirement: !ruby/object:Gem::Requirement
33
+ none: false
31
34
  requirements:
32
- - - "~>"
35
+ - - ~>
33
36
  - !ruby/object:Gem::Version
34
37
  version: '10.0'
38
+ type: :development
35
39
  prerelease: false
36
- requirement: !ruby/object:Gem::Requirement
40
+ version_requirements: !ruby/object:Gem::Requirement
41
+ none: false
37
42
  requirements:
38
- - - "~>"
43
+ - - ~>
39
44
  - !ruby/object:Gem::Version
40
45
  version: '10.0'
41
46
  - !ruby/object:Gem::Dependency
42
- type: :development
43
47
  name: yard
44
- version_requirements: !ruby/object:Gem::Requirement
48
+ requirement: !ruby/object:Gem::Requirement
49
+ none: false
45
50
  requirements:
46
- - - "~>"
51
+ - - ~>
47
52
  - !ruby/object:Gem::Version
48
53
  version: '0.8'
54
+ type: :development
49
55
  prerelease: false
50
- requirement: !ruby/object:Gem::Requirement
56
+ version_requirements: !ruby/object:Gem::Requirement
57
+ none: false
51
58
  requirements:
52
- - - "~>"
59
+ - - ~>
53
60
  - !ruby/object:Gem::Version
54
61
  version: '0.8'
55
62
  - !ruby/object:Gem::Dependency
56
- type: :development
57
63
  name: simplecov
58
- version_requirements: !ruby/object:Gem::Requirement
64
+ requirement: !ruby/object:Gem::Requirement
65
+ none: false
59
66
  requirements:
60
- - - "~>"
67
+ - - ~>
61
68
  - !ruby/object:Gem::Version
62
69
  version: 0.9.1
70
+ type: :development
63
71
  prerelease: false
64
- requirement: !ruby/object:Gem::Requirement
72
+ version_requirements: !ruby/object:Gem::Requirement
73
+ none: false
65
74
  requirements:
66
- - - "~>"
75
+ - - ~>
67
76
  - !ruby/object:Gem::Version
68
77
  version: 0.9.1
69
78
  - !ruby/object:Gem::Dependency
70
- type: :development
71
79
  name: rubocop
72
- version_requirements: !ruby/object:Gem::Requirement
80
+ requirement: !ruby/object:Gem::Requirement
81
+ none: false
73
82
  requirements:
74
- - - "~>"
83
+ - - ~>
75
84
  - !ruby/object:Gem::Version
76
85
  version: '0.29'
86
+ type: :development
77
87
  prerelease: false
78
- requirement: !ruby/object:Gem::Requirement
88
+ version_requirements: !ruby/object:Gem::Requirement
89
+ none: false
79
90
  requirements:
80
- - - "~>"
91
+ - - ~>
81
92
  - !ruby/object:Gem::Version
82
93
  version: '0.29'
83
94
  description: Collection of expectation matchers for Ruby.
@@ -87,9 +98,9 @@ executables: []
87
98
  extensions: []
88
99
  extra_rdoc_files: []
89
100
  files:
90
- - ".gitignore"
91
- - ".travis.yml"
92
- - ".yardopts"
101
+ - .gitignore
102
+ - .travis.yml
103
+ - .yardopts
93
104
  - CODE_OF_CONDUCT.md
94
105
  - Gemfile
95
106
  - LICENSE.md
@@ -110,26 +121,33 @@ files:
110
121
  homepage: https://github.com/fixrb/matchi
111
122
  licenses:
112
123
  - MIT
113
- metadata: {}
114
124
  post_install_message:
115
125
  rdoc_options: []
116
126
  require_paths:
117
127
  - lib
118
128
  required_ruby_version: !ruby/object:Gem::Requirement
129
+ none: false
119
130
  requirements:
120
- - - ">="
131
+ - - ! '>='
121
132
  - !ruby/object:Gem::Version
122
133
  version: '0'
134
+ segments:
135
+ - 0
136
+ hash: 3719578946741581766
123
137
  required_rubygems_version: !ruby/object:Gem::Requirement
138
+ none: false
124
139
  requirements:
125
- - - ">="
140
+ - - ! '>='
126
141
  - !ruby/object:Gem::Version
127
142
  version: '0'
143
+ segments:
144
+ - 0
145
+ hash: 3719578946741581766
128
146
  requirements: []
129
147
  rubyforge_project:
130
- rubygems_version: 2.4.5
148
+ rubygems_version: 1.8.23.2
131
149
  signing_key:
132
- specification_version: 4
150
+ specification_version: 3
133
151
  summary: Collection of matchers.
134
152
  test_files: []
135
153
  has_rdoc:
checksums.yaml DELETED
@@ -1,7 +0,0 @@
1
- ---
2
- SHA1:
3
- metadata.gz: f5bdd9213799cfeb48e7ecf65f25b19f126c3c12
4
- data.tar.gz: 0ac41824d9ba957e356af42d09c19fb87c5269a8
5
- SHA512:
6
- metadata.gz: 7f6d64db6e7fdb44b2aeaca890f427420ad1ff4b7f678ea18f57f4d96d97a4a0e8f8c4287ad5562d63e09017de537bc64b09b70c97556f652169097c3732a5a6
7
- data.tar.gz: c23052d210261ef309e1d13c785ae5b8adaf92795e82a5fbf435ccc5261f99436f18177ff120ce04b0a4503f303960a606b05eadfaf7c79031d0b7c87dd237dd