spec/parameters_spec.rb in parameters-0.2.0 vs spec/parameters_spec.rb in parameters-0.2.1
- old
+ new
@@ -1,17 +1,32 @@
require 'parameters/parameters'
require 'spec_helper'
+require 'classes/module_parameters'
require 'classes/test_parameters'
require 'classes/custom_parameters'
require 'classes/inherited_parameters'
require 'classes/other_parameters'
describe Parameters do
- describe "in a Class" do
+ context "in a Module" do
it "should provide parameters" do
+ ModuleParameters.should have_param(:mixin_var)
+ end
+
+ it "should re-extend ClassMethods when including the module" do
+ new_class = Class.new do
+ include ModuleParameters
+ end
+
+ new_class.should have_param(:mixin_var)
+ end
+ end
+
+ context "in a Class" do
+ it "should provide parameters" do
TestParameters.params.should_not be_empty
end
it "can have default values for parameters" do
TestParameters.param_value(:var_with_default).should == 'thing'
@@ -74,10 +89,10 @@
obj.var.should == 2
obj.var_with_default.should == 'stuff'
end
end
- describe "in an Object" do
+ context "in an Object" do
before(:each) do
@test = TestParameters.new
@test_inherited = InheritedParameters.new
end