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.
@@ -1,3 +1,3 @@
1
1
  module MicroMock
2
- VERSION = "0.0.5"
2
+ VERSION = "0.0.6"
3
3
  end
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=nil)
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
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
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.5
4
+ version: 0.0.6
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors: