micro_mock 0.0.5 → 0.0.6
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/micro_mock/version.rb +1 -1
- data/lib/micro_mock.rb +5 -16
- metadata +1 -1
data/lib/micro_mock/version.rb
CHANGED
data/lib/micro_mock.rb
CHANGED
@@ -61,26 +61,15 @@ module MicroMock
|
|
61
61
|
end
|
62
62
|
|
63
63
|
# Defines a mock class.
|
64
|
-
def self.make(superclass=
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
super
|
70
|
-
end
|
71
|
-
end
|
72
|
-
else
|
73
|
-
klass = Class.new do
|
74
|
-
def initialize(*args)
|
75
|
-
@args = args
|
76
|
-
end
|
64
|
+
def self.make(superclass=Object)
|
65
|
+
klass = Class.new(superclass) do
|
66
|
+
def initialize(*args)
|
67
|
+
@args = args
|
68
|
+
super unless self.class.superclass == Object
|
77
69
|
end
|
78
70
|
end
|
79
71
|
klass.extend MicroMock
|
80
72
|
klass.send :include, MicroMock
|
81
|
-
def klass.initialize(*args)
|
82
|
-
super
|
83
|
-
end
|
84
73
|
Object.const_set "MicroMock#{klass.object_id}", klass
|
85
74
|
klass
|
86
75
|
end
|