spec/adhearsion/plugin_spec.rb in adhearsion-2.0.0.beta1 vs spec/adhearsion/plugin_spec.rb in adhearsion-2.0.0.rc1
- old
+ new
@@ -1,5 +1,7 @@
+# encoding: utf-8
+
require 'spec_helper'
include InitializerStubs
describe Adhearsion::Plugin do
@@ -13,24 +15,24 @@
defined?(FooBar) and Object.send(:remove_const, :"FooBar")
end
it "should provide the plugin name in a plugin class" do
::FooBar = Class.new Adhearsion::Plugin
- ::FooBar.plugin_name.should == "foo_bar"
+ ::FooBar.plugin_name.should be == "foo_bar"
end
it "should provide the plugin name in a plugin instance" do
::FooBar = Class.new Adhearsion::Plugin
- ::FooBar.new.plugin_name.should == "foo_bar"
+ ::FooBar.new.plugin_name.should be == "foo_bar"
end
it "should provide a setter for plugin name" do
::FooBar = Class.new Adhearsion::Plugin do
self.plugin_name = "bar_foo"
end
- ::FooBar.plugin_name.should == "bar_foo"
+ ::FooBar.plugin_name.should be == "bar_foo"
end
end
describe "While configuring plugins" do
after(:each) do
@@ -45,32 +47,32 @@
host "localhost", :desc => "valid IP or hostname"
end
end
}
- its(:plugin_name) { should == :bar_foo }
+ its(:plugin_name) { should be == :bar_foo }
its(:config) { should be_instance_of Loquacious::Configuration }
it "should keep a default configuration and a description" do
[:name, :password, :host].each do |value|
subject.config.should respond_to value
end
- subject.config.name.should == "user"
- subject.config.password.should == "password"
- subject.config.host.should == "localhost"
+ subject.config.name.should be == "user"
+ subject.config.password.should be == "password"
+ subject.config.host.should be == "localhost"
end
it "should return a description of configuration options" do
subject.show_description.should be_kind_of Loquacious::Configuration::Help
end
describe "while updating config values" do
it "should return the updated value" do
subject.config.name = "usera"
- subject.config.name.should == "usera"
+ subject.config.name.should be == "usera"
end
end
end
@@ -103,21 +105,23 @@
Adhearsion::Plugin.count.should eql(number + 1)
end
end
describe "Adhearsion::Plugin.init_plugins" do
- before do
+ before(:all) do
Adhearsion::Plugin.class_eval do
def self.reset_methods_scope
@methods_scope = Hash.new { |hash, key| hash[key] = Module.new }
end
def self.reset_subclasses
@subclasses = nil
end
end
+ end
+ before do
Adhearsion::Plugin.reset_methods_scope
Adhearsion::Plugin.reset_subclasses
end
after do
@@ -338,32 +342,32 @@
it "should return an Array" do
subject.should be_instance_of Array
end
- its(:length) { should == 0 }
+ its(:length) { should be == 0 }
it "should not load a new task when there is no block in the method call" do
- subject.length.should == 0
+ subject.length.should be == 0
FooBar = Class.new Adhearsion::Plugin do
tasks
end
- subject.length.should == 0
+ subject.length.should be == 0
end
it "should load a new task when there is a block in the method call" do
- subject.length.should == 0
+ subject.length.should be == 0
FooBar = Class.new Adhearsion::Plugin do
tasks do
puts "foo bar"
end
end
- Adhearsion::Plugin.tasks.length.should == 1
+ Adhearsion::Plugin.tasks.length.should be == 1
end
it "should execute the tasks blocks while loading rake tasks" do
- subject.length.should == 0
+ subject.length.should be == 0
FooBar = Class.new Adhearsion::Plugin do
tasks do
FooBar.foo
end
def self.foo