micro_mock 0.0.4 → 0.0.5

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,3 +1,3 @@
1
1
  module MicroMock
2
- VERSION = "0.0.4"
2
+ VERSION = "0.0.5"
3
3
  end
data/lib/micro_mock.rb CHANGED
@@ -62,10 +62,25 @@ module MicroMock
62
62
 
63
63
  # Defines a mock class.
64
64
  def self.make(superclass=nil)
65
- klass = Class.new(superclass) if superclass
66
- klass ||= Class.new
65
+ if superclass
66
+ klass = Class.new(superclass) do
67
+ def initialize(*args)
68
+ @args = args
69
+ super
70
+ end
71
+ end
72
+ else
73
+ klass = Class.new do
74
+ def initialize(*args)
75
+ @args = args
76
+ end
77
+ end
78
+ end
67
79
  klass.extend MicroMock
68
80
  klass.send :include, MicroMock
81
+ def klass.initialize(*args)
82
+ super
83
+ end
69
84
  Object.const_set "MicroMock#{klass.object_id}", klass
70
85
  klass
71
86
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: micro_mock
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.4
4
+ version: 0.0.5
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors: