Created
December 24, 2009 22:35
-
-
Save BenHall/263400 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'java' | |
require 'out.jar' | |
include_class Java::ImplementingMockableClass | |
i = ImplementingMockableClass.new(v) | |
puts i.output_string | |
class ClassWithInterface | |
def get_string | |
"mocked" | |
end | |
end | |
i = ImplementingMockableClass.new(v) | |
puts i.output_string | |
class Faked | |
include Java::IInterface | |
def get_string | |
"Jruby Mocked" | |
end | |
end | |
i = ImplementingMockableClass.new(Faked.new) | |
puts i.output_string |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ImplementingMockableClass - ClassWithInterface - GetString() | |
ImplementingMockableClass - ClassWithInterface - GetString() | |
ImplementingMockableClass - Jruby Mocked |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment