Skip to content

Instantly share code, notes, and snippets.

@moretea
Created October 10, 2011 00:05
Show Gist options
  • Select an option

  • Save moretea/1274400 to your computer and use it in GitHub Desktop.

Select an option

Save moretea/1274400 to your computer and use it in GitHub Desktop.
require "fast_helper"
require "businessr/core/plugins"
require "businessr/plugins"
# => Both not needed because of the mocking of the plugin
#require "businessr/core/plugin"
#require "businessr/plugin"
describe BusinessR::Core::Plugins do
let(:plugins) { BusinessR::Core::Plugins.new }
let(:plugin) { Class.new }
it "should register plugins" do
lambda {
plugins.register(plugin)
}.should change(plugins, :count).by(1)
end
it "should include helper method in the plugin" do
lambda {
plugins.register(plugin)
}.should change { plugin.respond_to?(:plugin) }.from(false).to(true)
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment