spec/lib/locomotive/plugin_spec.rb in locomotive_plugins-1.0.0.beta9 vs spec/lib/locomotive/plugin_spec.rb in locomotive_plugins-1.0.0.beta10
- old
+ new
@@ -3,30 +3,20 @@
module Locomotive
describe Plugin do
before(:each) do
- @config = {}
- @plugin = MyPlugin.new(@config)
- @useless_plugin = UselessPlugin.new(@config)
+ @plugin = MyPlugin.new
+ @useless_plugin = UselessPlugin.new
end
- it 'should call custom initialization methods' do
- @plugin.custom_attribute.should == 'Value'
- end
-
- it 'should call the given block before custom initialization methods' do
- @plugin = MyPlugin.new(@config) do |obj|
- obj.custom_attribute.should be_nil
- end
- @plugin.custom_attribute.should_not be_nil
- end
-
- it 'should have filter callbacks' do
- @plugin.expects(:my_method1)
- @plugin.expects(:my_method2)
- @plugin.expects(:my_method3)
- @plugin.run_callbacks(:filter) do
+ %w{page_render rack_app_request}.each do |type|
+ it "should have #{type} callbacks" do
+ @plugin.expects(:my_method1)
+ @plugin.expects(:my_method2)
+ @plugin.expects(:my_method3)
+ @plugin.run_callbacks(:"#{type}") do
+ end
end
end
it 'should optionally return a liquid drop' do
@plugin.to_liquid.class.should == MyPlugin::MyDrop