Created
December 19, 2012 22:09
-
-
Save Groogy/4341007 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 "../dist/frozen-urchin.jar" | |
class TestLibrary | |
include Java::org.fu.script.Library | |
def apply_library(container) | |
end | |
end | |
describe Java::org.fu.script.ScriptController do | |
it "should undefine Java module with default library" do | |
library = Java::org.fu.script.DefaultLibrary.new | |
controller = Java::org.fu.script.ScriptController.new library | |
controller.executeScript("Object.constants.include?(:Java)").should == false | |
end | |
it "should call #apply_library on provided library" do | |
library = TestLibrary.new | |
library.should_receive :apply_library | |
controller = Java::org.fu.script.ScriptController.new library | |
end | |
it "should have Java defined with empty library" do | |
library = TestLibrary.new | |
controller = Java::org.fu.script.ScriptController.new library | |
controller.executeScript("Object.constants.include?(:Java)").should == true | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment