Permalink
Browse files

Add more extension specs for better coverage

  • Loading branch information...
1 parent e32af20 commit 2c358c5349f1a828d127616602be92f00f8c5ea6 @jeremyevans committed Jan 10, 2013
View
6 spec/extensions/migration_spec.rb
@@ -55,6 +55,12 @@
m.apply(@db, :up).should == nil
m.apply(@db, :down).should == nil
end
+
+ specify "should respond to the methods the database responds to" do
+ m = Sequel::Migration.new(Sequel.mock)
+ m.respond_to?(:foo).should be_false
+ m.respond_to?(:execute).should be_true
+ end if RUBY_VERSION >= '1.9'
end
describe "SimpleMigration#apply" do
View
3 spec/extensions/single_table_inheritance_spec.rb
@@ -158,6 +158,9 @@ class ::StiTest4 < ::StiTest2; end
StiTest2.create.kind.should == 4
StiTest3.create.kind.should == 5
StiTest4.create.kind.should == 6
+
+ class ::StiTest5 < ::StiTest4; end
+ StiTest5.create.kind.should == nil
end
it "should infer key_map from model_map if provided as a hash" do
View
8 spec/extensions/validation_class_methods_spec.rb
@@ -138,6 +138,14 @@ def o.aa
o.valid?.should == false
o.errors.full_messages.should == ['blah is not cool']
end
+
+ specify "should have the validates block have appropriate respond_to?" do
+ c = nil
+ @c.validates{c = respond_to?(:foo)}
+ c.should be_false
+ @c.validates{c = respond_to?(:length_of)}
+ c.should be_true
+ end if RUBY_VERSION >= '1.9'
end
describe Sequel::Model do

0 comments on commit 2c358c5

Please sign in to comment.