Browse files

add spec that checks ys config to anonymous_spec

  • Loading branch information...
1 parent f1b0e3f commit 44c61244681e7c1d02166a71a778729b43408681 @maiha maiha committed Mar 7, 2009
Showing with 13 additions and 2 deletions.
  1. +3 −2 lib/dm-ys/base.rb
  2. +10 −0 spec/anonymous_spec.rb
View
5 lib/dm-ys/base.rb
@@ -29,10 +29,11 @@ def self.descendants
# @api public
def self.[](uri)
- klass = Class.new do
+ klass = Class.new
+ klass.class_eval do
include DataMapper::YunkerStar
+ self.uri uri
end
- klass.uri uri
return klass
end
end
View
10 spec/anonymous_spec.rb
@@ -19,6 +19,16 @@
@ys.ancestors.should be_include(DataMapper::YunkerStar)
end
+ it "should have ys option" do
+ @ys.should respond_to(:ys)
+ end
+
+ describe ".ys" do
+ it "should return a kind of Config" do
+ @ys.ys.should be_kind_of(DataMapper::YunkerStar::Config)
+ end
+ end
+
it "should set uri" do
@ys.uri.should == @uri
end

0 comments on commit 44c6124

Please sign in to comment.