Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Lori Holden
committed
Dec 22, 2008
1 parent
cce1be9
commit 60460b2
Showing
7 changed files
with
82 additions
and
43 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1 @@ | |||
test.db |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1,11 @@ | |||
--- | |||
development: &defaults | |||
adapter: sqlite | |||
encoding: utf8 | |||
database: spec/test.db | |||
|
|||
test: | |||
<<: *defaults | |||
|
|||
production: | |||
<<: *defaults |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -1,31 +1,25 @@ | |||
require File.dirname(__FILE__) + "/spec_helper" | require File.dirname(__FILE__) + "/spec_helper" | ||
require 'merb-core/dispatch/session/store_container' | |||
require File.join( File.dirname(__FILE__), "..", "lib", 'merb', 'session', 'sequel_session') | |||
|
|
||
# # Load up the shared specs from merb-core | describe Merb::SequelSession do | ||
# 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') | before(:each) do | ||
# require gem_spec.full_gem_path / 'spec/public/session/controllers/sessions.rb' | @session_class = Merb::SequelSession | ||
# require gem_spec.full_gem_path / 'spec/public/session/session_spec.rb' | @session = @session_class.generate | ||
# end | end | ||
# |
|
||
# describe Merb::SequelSession do | it "should have a session_store_type class attribute" do | ||
# | @session.class.session_store_type.should == :sequel | ||
# before do | end | ||
# @session_class = Merb::SequelSession |
|
||
# @session = @session_class.generate | it "should persist values" do | ||
# end | response = request(url(:controller => :spec_controller, :action => :set)) | ||
# | response.should be_successful | ||
# it_should_behave_like "All session-store backends" | response.body.should == 'value' | ||
# | response = request(url(:controller => :spec_controller, :action => :get)) | ||
# it "should have a session_store_type class attribute" do | response.should be_successful | ||
# @session.class.session_store_type.should == :sequel | response.body.should == 'value' | ||
# end | end | ||
# |
|
||
# 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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1,9 @@ | |||
class SpecController < Merb::Controller | |||
def set | |||
session[:key] = 'value' | |||
end | |||
|
|||
def get | |||
session[:key] | |||
end | |||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1,25 @@ | |||
class SpecModel < Sequel::Model | |||
end | |||
|
|||
class CreateSpecModel < Sequel::Migration | |||
def up | |||
create_table! :spec_models do | |||
primary_key :id | |||
text :name | |||
end | |||
end | |||
|
|||
def down | |||
drop_table :spec_models | |||
end | |||
end | |||
|
|||
describe "it has a SpecModel", :shared => true do | |||
before(:each) do | |||
CreateSpecModel.apply(SpecModel.db, :up) | |||
end | |||
|
|||
after(:each) do | |||
CreateSpecModel.apply(SpecModel.db, :down) | |||
end | |||
end |