muack 1.3.0 → 1.3.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGES.md +5 -0
- data/lib/muack/satisfying.rb +4 -4
- data/lib/muack/version.rb +1 -1
- data/muack.gemspec +3 -3
- data/test/test_satisfying.rb +14 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 44cee556b89d8eb6f0b0cf73e9082a41c24f0c07
|
4
|
+
data.tar.gz: 3843d7a99fd975384d3faccce6b4235ce3d273f3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5a50371ce353f2063dcbf323e3089b51a8c3e45bb1dd0b1b14882dd0849b4d499e5c61a6dc64ac7a4db9ecd84a11085db9ad95507633fcdaac029fd9b5551611
|
7
|
+
data.tar.gz: b21dbd44169cea461871d4d67ddc9cdb7fecf0b41378b118046b82093e5690165da8c69f907f20d602da8d935c7e50b06896c92ae4149faeb9f641ba6e4000a5
|
data/CHANGES.md
CHANGED
data/lib/muack/satisfying.rb
CHANGED
@@ -123,9 +123,9 @@ module Muack
|
|
123
123
|
def match actual_arg, spec=api_args.first
|
124
124
|
case spec
|
125
125
|
when Hash
|
126
|
-
match_hash(actual_arg, spec)
|
126
|
+
actual_arg.kind_of?(Hash) && match_hash(actual_arg, spec)
|
127
127
|
when Array
|
128
|
-
match_array(actual_arg, spec)
|
128
|
+
actual_arg.kind_of?(Array) && match_array(actual_arg, spec)
|
129
129
|
else
|
130
130
|
raise UnknownSpec.new(spec)
|
131
131
|
end
|
@@ -149,9 +149,9 @@ module Muack
|
|
149
149
|
when Satisfying
|
150
150
|
ev.match(av)
|
151
151
|
when Hash
|
152
|
-
match_hash(av, ev)
|
152
|
+
av.kind_of?(Hash) && match_hash(av, ev)
|
153
153
|
when Array
|
154
|
-
match_array(av, ev)
|
154
|
+
av.kind_of?(Array) && match_array(av, ev)
|
155
155
|
else
|
156
156
|
ev == av
|
157
157
|
end
|
data/lib/muack/version.rb
CHANGED
data/muack.gemspec
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
# -*- encoding: utf-8 -*-
|
2
|
-
# stub: muack 1.3.
|
2
|
+
# stub: muack 1.3.1 ruby lib
|
3
3
|
|
4
4
|
Gem::Specification.new do |s|
|
5
5
|
s.name = "muack"
|
6
|
-
s.version = "1.3.
|
6
|
+
s.version = "1.3.1"
|
7
7
|
|
8
8
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
9
9
|
s.require_paths = ["lib"]
|
10
10
|
s.authors = ["Lin Jen-Shin (godfat)"]
|
11
|
-
s.date = "2015-05-
|
11
|
+
s.date = "2015-05-27"
|
12
12
|
s.description = "Muack -- A fast, small, yet powerful mocking library.\n\nInspired by [RR][], and it's 32x times faster (750s vs 23s) than RR\nfor running [Rib][] tests.\n\n[RR]: https://github.com/rr/rr\n[Rib]: https://github.com/godfat/rib"
|
13
13
|
s.email = ["godfat (XD) godfat.org"]
|
14
14
|
s.files = [
|
data/test/test_satisfying.rb
CHANGED
@@ -215,6 +215,20 @@ describe Muack::Satisfying do
|
|
215
215
|
e.was .should.eq 'obj.say({:a=>0, :b=>1, :c=>2})'
|
216
216
|
e.message .should.eq "\nExpected: #{e.expected}\n but was: #{e.was}"
|
217
217
|
end
|
218
|
+
|
219
|
+
would 'recurse' do
|
220
|
+
mock(Obj).say(where(:a =>
|
221
|
+
having(:b =>
|
222
|
+
allowing(:c => [is_a(Fixnum)])))){ 'boo' }
|
223
|
+
e = should.raise(Muack::Unexpected){Obj.say(:a => 0)}
|
224
|
+
e.expected.should.eq \
|
225
|
+
'obj.say(Muack::API.where({:a=>' \
|
226
|
+
'Muack::API.having({:b=>' \
|
227
|
+
'Muack::API.allowing({:c=>' \
|
228
|
+
'[Muack::API.is_a(Fixnum)]})})}))'
|
229
|
+
e.was .should.eq 'obj.say({:a=>0})'
|
230
|
+
e.message .should.eq "\nExpected: #{e.expected}\n but was: #{e.was}"
|
231
|
+
end
|
218
232
|
end
|
219
233
|
|
220
234
|
describe Muack::Having do
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: muack
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.3.
|
4
|
+
version: 1.3.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Lin Jen-Shin (godfat)
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-05-
|
11
|
+
date: 2015-05-27 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: |-
|
14
14
|
Muack -- A fast, small, yet powerful mocking library.
|