lib/fakes.rb in fakes-0.3.2 vs lib/fakes.rb in fakes-0.3.7
- old
+ new
@@ -5,19 +5,28 @@
require 'core/arg_matching/combined_arg_matcher'
require 'core/arg_matching/matches'
require 'core/arg_matching/regular_arg_matcher'
require 'core/arg_behaviour'
require 'core/arg_set'
+require 'core/class_swap'
+require 'core/class_swaps'
require 'core/fake'
require 'core/ignore_set'
require 'core/method_stub'
+require 'singleton'
-module Kernel
+class Object
def fake
return Fakes::Fake.new
end
-end
-class Object
def matches
return Fakes::Matches
+ end
+ def fake_class(klass)
+ item = fake
+ Fakes::ClassSwaps.instance.add_fake_for(klass,item)
+ item
+ end
+ def reset_fake_classes
+ Fakes::ClassSwaps.instance.reset
end
end