wildcard_matchers 0.1.6 → 0.1.7

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: e3d9d80d3859e5ea8f844eb3c15967d102d755a6
4
- data.tar.gz: 9f1322c48ee56fe565277ab5333340ad770f47c4
3
+ metadata.gz: 16a8d8b0edac8954945e5018a609e69ffd257831
4
+ data.tar.gz: 1dba61fbe05640ade3e9bb51cdbd44d403183433
5
5
  SHA512:
6
- metadata.gz: c70ea80a0a931e7cab5e4940aa2993f67b86c0e6cc00b50cd91d188eef3b2b67a89398f03014e036ba2ccdb4ac0ac7cf6fcdf590095b46b6ca2b38de0cd427c1
7
- data.tar.gz: e799e0cb2eeb1829740e6651d550969bec2c0896a5403199949c7ce2fd7ed347d80289551a040aaaf8051b93c06d34c1523b4202387da041c7fd92ef51dcb690
6
+ metadata.gz: b65c2dffab4acc2aca7f8de06a4fd664a69d4ce824d74137808c6d7e3081d86a38797b737bfaad5666bd5b55498a54ff69cde6c8bf770b549b3f74a763ef97ba
7
+ data.tar.gz: f0862de1b4bc36cb6de370e41e5583a5e56ab309eae25b0c246c8b6a65f5e51d8cb1596deee14363973b2030276897ff1e1d250f004e9f5f8df2ef50982335dd
data/CHANGELOG.md CHANGED
@@ -1,3 +1,8 @@
1
+ ## 0.1.7
2
+ * FIX
3
+ * bug of hash_includes corrupts expectation
4
+ * bug of using without rspec
5
+
1
6
  ## 0.1.6
2
7
  * ENHANCEMENT
3
8
  * add reponding helper to check object attribute with hash
data/README.md CHANGED
@@ -28,8 +28,8 @@ See specs, for more detail.
28
28
  * is_bool === object #=> false
29
29
  * is_time
30
30
  * is_time === "2012-05-13" #=> true
31
- * is_url
32
- * is_url(:host => "example.com") === "http://example.com" #=> true
31
+ * is_uri
32
+ * is_uri(:host => "example.com") === "http://example.com" #=> true
33
33
  * with_uri_template
34
34
  * with_uri_template("http://example.com/users/{id}", "id" => "1") === "http://example.com/users/1" #=> true
35
35
  * with_uri_template("http://example.com/users{?id}", "id" => "1") === "http://example.com/users?id=1" #=> true
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.1.6
1
+ 0.1.7
@@ -11,15 +11,14 @@ module WildcardMatchers
11
11
  return
12
12
  end
13
13
 
14
- hash_to_match = {}
15
- hash_to_match = expectation.pop if expectation.last.is_a?(Hash)
16
-
17
14
  expectation.each do |key|
18
- errors << "#{position}: expect #{actual} to have key #{key}" unless actual.has_key?(key)
19
- end
20
-
21
- hash_to_match.each do |key, value|
22
- errors.push(*self.class.superclass.check_errors(actual[key], value, position + "[#{key.inspect}]"))
15
+ unless key.is_a?(Hash)
16
+ errors << "#{position}: expect #{actual} to have key #{key}" unless actual.has_key?(key)
17
+ else
18
+ key.each do |key, value|
19
+ errors.push(*self.class.superclass.check_errors(actual[key], value, position + "[#{key.inspect}]"))
20
+ end
21
+ end
23
22
  end
24
23
  end
25
24
  end
@@ -46,7 +46,7 @@ module WildcardMatchers
46
46
  when Hash
47
47
  errors.push(*HashMatcher.check_errors(actual, expectation, position))
48
48
  else
49
- if defined?(:"::RSpec::Matchers::DSL::Matcher") \
49
+ if defined?(::RSpec::Matchers::DSL::Matcher) \
50
50
  && ::RSpec::Matchers::DSL::Matcher === expectation \
51
51
  && (expected = expectation.expected.first).is_a?(self.class)
52
52
  # if duplicated wildcard_match extract it
@@ -14,4 +14,10 @@ describe WildcardMatchers::Matchers::HashIncludes do
14
14
  ].each do |actual, matcher, *args|
15
15
  it_behaves_like "not wildcard match", actual, matcher, *args
16
16
  end
17
+
18
+ # bug
19
+ it "cannot be corrupted" do
20
+ matcher = hash_includes(a: 1)
21
+ 2.times { wildcard_match?({ a: 2 }, matcher, &debugger).should be_false }
22
+ end
17
23
  end
@@ -26,7 +26,7 @@ describe WildcardMatchers::Matchers::WithUriTemplate do
26
26
  it_behaves_like "not wildcard match", actual, matcher, *args
27
27
  end
28
28
 
29
- context "with without_query!", :focused do
29
+ context "with without_query!" do
30
30
  it "works" do
31
31
  wildcard_match?(
32
32
  "http://example.com/?hoge=fuga&fuga=ugu",
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.1.6
4
+ version: 0.1.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - okitan
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-05-06 00:00:00.000000000 Z
11
+ date: 2013-07-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: facets
@@ -186,7 +186,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
186
186
  version: '0'
187
187
  requirements: []
188
188
  rubyforge_project:
189
- rubygems_version: 2.0.3
189
+ rubygems_version: 2.0.5
190
190
  signing_key:
191
191
  specification_version: 4
192
192
  summary: wildcard matchers which can use in rspec