Permalink
Browse files

Merge branch 'merb_sequel-specs' of git://github.com/jdunphy/merb-plu…

…gins into specs
  • Loading branch information...
2 parents 530d18a + 68e04af commit 564f3e4e4491491d21a2b739aa1e560647e9717e Lori committed Dec 19, 2008
View
3 merb_sequel/TODO
@@ -1,2 +1,3 @@
TODO:
-* More meaningful messages for cases with misconfigured database.yml.
+* More meaningful messages for cases with misconfigured database.yml.
+* Some specs would be nice.
View
47 merb_sequel/spec/merb_sequel_session_spec.rb
@@ -0,0 +1,47 @@
+$:.push File.join(File.dirname(__FILE__), '..', 'lib')
+require 'rubygems'
+require 'merb-core'
+require 'merb-core/test'
+require 'merb-core/test/helpers'
+
+Merb::BootLoader.before_app_loads do
+ require 'sequel'
+ DB = Sequel.sqlite
+ require "merb/session/sequel_session"
+end
+
+Merb.start :environment => 'test', :adapter => 'runner', :session_store => 'sequel'
+
+Spec::Runner.configure do |config|
+ config.include Merb::Test::RequestHelper
+end
+
+# # Load up the shared specs from merb-core
+# if (gem_spec = Gem.source_index.search(Gem::Dependency.new('merb-core', '>=0.9.6')).last) &&
+# gem_spec.files.include?('spec/public/session/controllers/sessions.rb')
+# require gem_spec.full_gem_path / 'spec/public/session/controllers/sessions.rb'
+# require gem_spec.full_gem_path / 'spec/public/session/session_spec.rb'
+# end
+#
+# describe Merb::SequelSession do
+#
+# before do
+# @session_class = Merb::SequelSession
+# @session = @session_class.generate
+# end
+#
+# it_should_behave_like "All session-store backends"
+#
+# it "should have a session_store_type class attribute" do
+# @session.class.session_store_type.should == :sequel
+# end
+#
+# end
+#
+# describe Merb::SequelSession, "mixed into Merb::Controller" do
+#
+# before(:all) { @session_class = Merb::SequelSession }
+#
+# it_should_behave_like "All session-stores mixed into Merb::Controller"
+#
+# end
View
11 merb_sequel/spec/merb_sequel_spec.rb
@@ -0,0 +1,11 @@
+require File.dirname(__FILE__) + "/spec_helper"
+
+describe Merb::Orms::Sequel::Connect do
+ it "is loaded at plugin bootstrap" do
+ defined?(Merb::Orms::Sequel::Connect).should == "constant"
+ end
+
+ it "is a merb BootLoader" do
+ Merb::Orms::Sequel::Connect.superclass.should eql(Merb::BootLoader)
+ end
+end
View
5 merb_sequel/spec/spec_helper.rb
@@ -0,0 +1,5 @@
+$:.push File.join(File.dirname(__FILE__), "..", "lib")
+require 'rubygems'
+require 'spec'
+require 'merb-core'
+require File.join( File.dirname(__FILE__), "..", "lib", 'merb_sequel')
View
46 merb_sequel/specs/merb_sequel_session_spec.rb
@@ -1,46 +0,0 @@
-$:.push File.join(File.dirname(__FILE__), '..', 'lib')
-require 'merb-core'
-require 'merb-core/test'
-require 'merb-core/test/helpers'
-
-Merb::BootLoader.before_app_loads do
- require 'sequel'
- DB = Sequel.sqlite
- require "merb/session/sequel_session"
-end
-
-Merb.start :environment => 'test', :adapter => 'runner', :session_store => 'sequel'
-
-Spec::Runner.configure do |config|
- config.include Merb::Test::RequestHelper
-end
-
-# Load up the shared specs from merb-core
-if (gem_spec = Gem.source_index.search(Gem::Dependency.new('merb-core', '>=0.9.6')).last) &&
- gem_spec.files.include?('spec/public/session/controllers/sessions.rb')
- require gem_spec.full_gem_path / 'spec/public/session/controllers/sessions.rb'
- require gem_spec.full_gem_path / 'spec/public/session/session_spec.rb'
-end
-
-describe Merb::SequelSession do
-
- before do
- @session_class = Merb::SequelSession
- @session = @session_class.generate
- end
-
- it_should_behave_like "All session-store backends"
-
- it "should have a session_store_type class attribute" do
- @session.class.session_store_type.should == :sequel
- end
-
-end
-
-describe Merb::SequelSession, "mixed into Merb::Controller" do
-
- before(:all) { @session_class = Merb::SequelSession }
-
- it_should_behave_like "All session-stores mixed into Merb::Controller"
-
-end
View
15 merb_sequel/specs/merb_sequel_spec.rb
@@ -1,15 +0,0 @@
-require File.dirname(__FILE__) + "/spec_helper"
-
-describe "merb_sequel" do
-
- it "should do nothing" do
- true.should == true
- end
-
-end
-
-describe "merb_sequel Generators" do
- it "should description" do
-
- end
-end
View
1 merb_sequel/specs/spec_helper.rb
@@ -1 +0,0 @@
-$:.push File.join(File.dirname(__FILE__), "..", "lib")

0 comments on commit 564f3e4

Please sign in to comment.