Skip to content

Instantly share code, notes, and snippets.

@Groogy
Created December 22, 2012 21:22
Show Gist options
  • Save Groogy/4361251 to your computer and use it in GitHub Desktop.
Save Groogy/4361251 to your computer and use it in GitHub Desktop.
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)") == 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)") == true
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment