wildcard_matchers 0.2.0 → 0.2.1

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: 853afdf97de17d19cae1c6f7703e48b314b70ae4
4
- data.tar.gz: fbc0e3281dc8fbd20219547f33fcc7f6497af99b
3
+ metadata.gz: 3c38dfa86fa011bfe6cedf7cd72b5d44144666ca
4
+ data.tar.gz: 22af55c3ae96ea0ee671c22f576b7155e220dec5
5
5
  SHA512:
6
- metadata.gz: f21ad64d86ec34f64620abc02e5d511e43b5440a1b7484665f11bb195fd263275f56a6cfed265a7f1ff425fde80706c699b7c7c2aca4aece5e6c7aa72f67fbc3
7
- data.tar.gz: ff2e4ba038cdd9fd96cd46a34a344b4f2ca37df3c8bc02256fb4d6f567d495b6928aeddad05dab9765cbc51bff9aee9a7e83a161fadf64ef917a6e431269e6e8
6
+ metadata.gz: 643a3bb8994f1cd26c2c06152539e55322086acd94498e53e4f534670b020b107186d023bf17ac8dc8dd640dd3afa20cc8a148ba5e6f1a814abeea73ced0854c
7
+ data.tar.gz: 8ca9ad272f497cd2c21d3f8a00ca4e82c16f1add74023291a124d7fc18e3ee44f3320b86f58c9c2d783583d69be99af2b4ef56bcc8df2a881430d7c59a67ab33
data/.gitignore CHANGED
@@ -15,3 +15,6 @@ spec/reports
15
15
  test/tmp
16
16
  test/version_tmp
17
17
  tmp
18
+
19
+ .ruby-version
20
+ .ruby-gemset
data/.travis.yml CHANGED
@@ -1,4 +1,11 @@
1
+ language: ruby
1
2
  rvm:
2
3
  - 1.9.2
3
4
  - 1.9.3
4
5
  - 2.0.0
6
+ - 2.2.0
7
+ gemfile:
8
+ - Gemfile
9
+ before_install: gem install bundler -v 1.10.5
10
+ sudo: false
11
+ cache: bundler
data/CHANGELOG.md CHANGED
@@ -1,3 +1,7 @@
1
+ ## 0.2.1
2
+ * ENHANCEMENT
3
+ * add bag_of like Test::Deep in perl
4
+
1
5
  ## 0.2.0
2
6
  * Update
3
7
  * wildcard_matchers now works on rspec3.x (@yuki-hirako)
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.2.0
1
+ 0.2.1
@@ -58,6 +58,7 @@ module WildcardMatchers
58
58
  end
59
59
  end
60
60
 
61
+ require "wildcard_matchers/matchers/bag"
61
62
  require "wildcard_matchers/matchers/hash_includes"
62
63
  require "wildcard_matchers/matchers/is_uri"
63
64
  require "wildcard_matchers/matchers/with_uri_template"
@@ -0,0 +1,12 @@
1
+ module WildcardMatchers
2
+ module Matchers
3
+ define_wildcard_matcher(:bag_of)
4
+
5
+ class BagOf < ::WildcardMatchers::WildcardMatcher
6
+ protected
7
+ def wildcard_match(actual)
8
+ errors.push(*WildcardMatchers::ArrayMatcher.check_errors(actual.sort, expectation.sort, position))
9
+ end
10
+ end
11
+ end
12
+ end
@@ -0,0 +1,14 @@
1
+ require "spec_helper"
2
+
3
+ describe WildcardMatchers::Matchers::HashIncludes do
4
+ [ [ [ 1, 2, 3 ], :bag_of, 3, 2, 1 ],
5
+ [ [ 1, 2, 3 ], :bag_of, 1, 2, 3 ],
6
+ ].each do |actual, matcher, *args|
7
+ it_behaves_like "wildcard match", actual, matcher, *args
8
+ end
9
+
10
+ [ [ [ 1, 2, 3 ], :bag_of, 1, 2 ],
11
+ ].each do |actual, matcher, *args|
12
+ it_behaves_like "not wildcard match", actual, matcher, *args
13
+ end
14
+ end
@@ -12,6 +12,8 @@ Gem::Specification.new do |gem|
12
12
  gem.name = "wildcard_matchers"
13
13
  gem.require_paths = ["lib"]
14
14
 
15
+ gem.license = 'MIT'
16
+
15
17
  gem.version = File.read(File.join(File.dirname(__FILE__), "VERSION")).chomp
16
18
 
17
19
  gem.add_dependency "facets"
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: wildcard_matchers
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - okitan
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-09-08 00:00:00.000000000 Z
11
+ date: 2015-07-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: facets
@@ -132,8 +132,6 @@ files:
132
132
  - ".coveralls.yml"
133
133
  - ".gitignore"
134
134
  - ".rspec"
135
- - ".ruby-gemset"
136
- - ".ruby-version"
137
135
  - ".travis.yml"
138
136
  - CHANGELOG.md
139
137
  - Gemfile
@@ -148,6 +146,7 @@ files:
148
146
  - lib/wildcard_matchers/helpers/nil_or.rb
149
147
  - lib/wildcard_matchers/helpers/responding.rb
150
148
  - lib/wildcard_matchers/matchers.rb
149
+ - lib/wildcard_matchers/matchers/bag.rb
151
150
  - lib/wildcard_matchers/matchers/hash_includes.rb
152
151
  - lib/wildcard_matchers/matchers/is_uri.rb
153
152
  - lib/wildcard_matchers/matchers/with_uri_template.rb
@@ -160,6 +159,7 @@ files:
160
159
  - spec/wildcard_matchers/helpers/for_any_spec.rb
161
160
  - spec/wildcard_matchers/helpers/nil_or_spec.rb
162
161
  - spec/wildcard_matchers/helpers/responding_spec.rb
162
+ - spec/wildcard_matchers/matchers/bag_spec.rb
163
163
  - spec/wildcard_matchers/matchers/hash_includes_spec.rb
164
164
  - spec/wildcard_matchers/matchers/is_uri_spec.rb
165
165
  - spec/wildcard_matchers/matchers/with_uri_template_spec.rb
@@ -168,7 +168,8 @@ files:
168
168
  - spec/wildcard_matchers_spec.rb
169
169
  - wildcard_matchers.gemspec
170
170
  homepage: https://github.com/okitan/wildcard_matchers
171
- licenses: []
171
+ licenses:
172
+ - MIT
172
173
  metadata: {}
173
174
  post_install_message:
174
175
  rdoc_options: []
@@ -186,7 +187,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
186
187
  version: '0'
187
188
  requirements: []
188
189
  rubyforge_project:
189
- rubygems_version: 2.2.2
190
+ rubygems_version: 2.4.6
190
191
  signing_key:
191
192
  specification_version: 4
192
193
  summary: wildcard matchers which can use in rspec
@@ -198,6 +199,7 @@ test_files:
198
199
  - spec/wildcard_matchers/helpers/for_any_spec.rb
199
200
  - spec/wildcard_matchers/helpers/nil_or_spec.rb
200
201
  - spec/wildcard_matchers/helpers/responding_spec.rb
202
+ - spec/wildcard_matchers/matchers/bag_spec.rb
201
203
  - spec/wildcard_matchers/matchers/hash_includes_spec.rb
202
204
  - spec/wildcard_matchers/matchers/is_uri_spec.rb
203
205
  - spec/wildcard_matchers/matchers/with_uri_template_spec.rb
data/.ruby-gemset DELETED
@@ -1 +0,0 @@
1
- wildcard_matchers
data/.ruby-version DELETED
@@ -1 +0,0 @@
1
- default