muack 1.0.1 → 1.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGES.md +7 -0
- data/lib/muack/stub.rb +2 -1
- data/lib/muack/version.rb +1 -1
- data/muack.gemspec +4 -4
- data/test/test_stub.rb +12 -0
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c6b8d14895660519e1ff47c5675958879c675f9f
|
4
|
+
data.tar.gz: 79f2de6572ae6502f1f8feebb28813df73914b68
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 49698fea906242ae5cc4acf155fbc824c3951db2a4410ce307c209616eacf982951248c4eaf2bdef77b98071fc8975ee18d15d063cc63128e2ae10e96cd59171
|
7
|
+
data.tar.gz: 0253b5b1fb8bc58b02f782a4fe261e557e9a891b0e7e766474f007016fa2fdbd8887435a0bc3533a3125dae480a44e1cf1bd46fde5574a5badf3b69420d7c5ac
|
data/CHANGES.md
CHANGED
@@ -1,5 +1,12 @@
|
|
1
1
|
# CHANGES
|
2
2
|
|
3
|
+
## Muack 1.0.2 -- 2014-01-17
|
4
|
+
|
5
|
+
* Fixed a bug where spies do not really verify against actual arguments,
|
6
|
+
but the definition from stubs. This might make stubs a bit slower as
|
7
|
+
now it needs to really create objects storing actual arguments.
|
8
|
+
Previously, it only reused its definitions thus no objects were created.
|
9
|
+
|
3
10
|
## Muack 1.0.1 -- 2014-01-07
|
4
11
|
|
5
12
|
* Fixed a regression where proxy with multiple arguments might not pass
|
data/lib/muack/stub.rb
CHANGED
@@ -10,7 +10,8 @@ module Muack
|
|
10
10
|
def __mock_dispatch msg, actual_args
|
11
11
|
if defi = __mock_defis[msg].find{ |d|
|
12
12
|
__mock_check_args(d.args, actual_args) }
|
13
|
-
|
13
|
+
# our spies are interested in this
|
14
|
+
__mock_disps_push(Definition.new(msg, actual_args))
|
14
15
|
defi
|
15
16
|
else
|
16
17
|
Mock.__send__(:raise, # Wrong argument
|
data/lib/muack/version.rb
CHANGED
data/muack.gemspec
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
# -*- encoding: utf-8 -*-
|
2
|
-
# stub: muack 1.0.
|
2
|
+
# stub: muack 1.0.2 ruby lib
|
3
3
|
|
4
4
|
Gem::Specification.new do |s|
|
5
5
|
s.name = "muack"
|
6
|
-
s.version = "1.0.
|
6
|
+
s.version = "1.0.2"
|
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 = "2014-01-
|
11
|
+
s.date = "2014-01-17"
|
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 = [
|
@@ -46,7 +46,7 @@ Gem::Specification.new do |s|
|
|
46
46
|
"test/test_stub.rb"]
|
47
47
|
s.homepage = "https://github.com/godfat/muack"
|
48
48
|
s.licenses = ["Apache License 2.0"]
|
49
|
-
s.rubygems_version = "2.2.
|
49
|
+
s.rubygems_version = "2.2.1"
|
50
50
|
s.summary = "Muack -- A fast, small, yet powerful mocking library."
|
51
51
|
s.test_files = [
|
52
52
|
"test/test_any_instance_of.rb",
|
data/test/test_stub.rb
CHANGED
@@ -61,6 +61,18 @@ describe Muack::Stub do
|
|
61
61
|
2.times{ Obj.say.should.eq nil }
|
62
62
|
2.times{ spy(Obj).say }
|
63
63
|
end
|
64
|
+
|
65
|
+
should 'verify spy arguments' do
|
66
|
+
stub(Obj).say(1){|a|a}
|
67
|
+
Obj.say(1).should.eq 1
|
68
|
+
spy( Obj).say(1)
|
69
|
+
end
|
70
|
+
|
71
|
+
should 'properly verify spy arguments' do
|
72
|
+
stub(Obj).say(is_a(String)){|a|a}
|
73
|
+
Obj.say('Hi!').should.eq 'Hi!'
|
74
|
+
spy( Obj).say(is_a(String))
|
75
|
+
end
|
64
76
|
end
|
65
77
|
|
66
78
|
describe 'Muack.verify==false' 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.0.
|
4
|
+
version: 1.0.2
|
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: 2014-01-
|
11
|
+
date: 2014-01-17 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: |-
|
14
14
|
Muack -- A fast, small, yet powerful mocking library.
|
@@ -76,7 +76,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
76
76
|
version: '0'
|
77
77
|
requirements: []
|
78
78
|
rubyforge_project:
|
79
|
-
rubygems_version: 2.2.
|
79
|
+
rubygems_version: 2.2.1
|
80
80
|
signing_key:
|
81
81
|
specification_version: 4
|
82
82
|
summary: Muack -- A fast, small, yet powerful mocking library.
|