riak-sessions 0.8.0 → 0.8.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -14,7 +14,9 @@
14
14
  require File.expand_path("../spec_helper", __FILE__)
15
15
  require 'rack/mock'
16
16
 
17
+
17
18
  describe Riak::SessionStore do
19
+ Riak::SessionStore::DEFAULT_OPTIONS[:port] = 9000 if $test_server
18
20
  session_key = Riak::SessionStore::DEFAULT_OPTIONS[:key]
19
21
  session_match = /#{session_key}=([0-9a-fA-F]+);/
20
22
  incrementor = lambda do |env|
@@ -21,7 +21,7 @@ describe "Ripple::SessionStore" do
21
21
 
22
22
  before :each do
23
23
  @app = build_app do |middleware|
24
- middleware.use Ripple::SessionStore, :key => '_session_id'
24
+ middleware.use Ripple::SessionStore, :key => '_session_id', :port => ($test_server ? 9000 : 8098)
25
25
  middleware.delete "ActionDispatch::ShowExceptions"
26
26
  end
27
27
  @app.routes.draw do
data/spec/spec_helper.rb CHANGED
@@ -19,11 +19,13 @@ require 'rubygems' # Use the gems path only for the spec suite
19
19
  require 'riak'
20
20
  %w{rails action_pack action_dispatch action_controller action_view}.each {|f| require f }
21
21
  require 'riak-sessions'
22
- require 'rspec/rails'
23
- require 'rspec/autorun'
22
+ require 'rspec'
24
23
 
25
24
  Dir[File.join(File.dirname(__FILE__), "support", "*.rb")].each {|f| require f }
26
25
 
27
26
  Rspec.configure do |config|
28
27
  config.mock_with :rspec
28
+ config.after(:each) do
29
+ $test_server.recycle if $test_server
30
+ end
29
31
  end
@@ -12,6 +12,7 @@
12
12
  # See the License for the specific language governing permissions and
13
13
  # limitations under the License.
14
14
 
15
+ require 'support/rspec-rails-neuter'
15
16
  require 'rspec/rails/example/request_example_group'
16
17
 
17
18
  class RoutedRackApp
@@ -0,0 +1,29 @@
1
+ # Copied from rspec-rails but bypassing the part that requires a Rails
2
+ # app
3
+ module RSpec
4
+ module Rails
5
+ class << self
6
+ def using_active_record?
7
+ #::Rails.configuration.generators.options[:rails][:orm] ==
8
+ #:active_record
9
+ false
10
+ end
11
+ end
12
+ end
13
+ end
14
+
15
+ RSpec::configure do |c|
16
+ c.backtrace_clean_patterns << /vendor\//
17
+ c.backtrace_clean_patterns << /lib\/rspec\/rails/
18
+ end
19
+
20
+ require 'rspec/core'
21
+ require 'rspec/rails/extensions'
22
+ require 'rspec/rails/view_rendering'
23
+ require 'rspec/rails/adapters'
24
+ require 'rspec/rails/matchers'
25
+ require 'rspec/rails/fixture_support'
26
+ require 'rspec/rails/mocks'
27
+ require 'rspec/rails/module_inclusion'
28
+ require 'rspec/rails/browser_simulators'
29
+ require 'rspec/rails/example'
@@ -0,0 +1,16 @@
1
+ require 'riak/test_server'
2
+
3
+ unless $test_server
4
+ begin
5
+ require 'yaml'
6
+ config = YAML.load_file("spec/support/test_server.yml")
7
+ $test_server = Riak::TestServer.new(config.symbolize_keys)
8
+ $test_server.prepare!
9
+ $test_server.start
10
+ at_exit { $test_server.cleanup }
11
+ rescue => e
12
+ warn "Can't run Riak::TestServer specs. Specify the location of your Riak installation in spec/support/test_server.yml. See Riak::TestServer docs for more info."
13
+ warn e.inspect
14
+ $test_server = nil
15
+ end
16
+ end
@@ -0,0 +1,2 @@
1
+ bin_dir: /Users/sean/Development/riak/rel/riak/bin
2
+ temp_dir: /Users/sean/Development/ripple/.riaktest
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 0
7
7
  - 8
8
- - 0
9
- version: 0.8.0
8
+ - 1
9
+ version: 0.8.1
10
10
  platform: ruby
11
11
  authors:
12
12
  - Sean Cribbs
@@ -14,7 +14,7 @@ autorequire:
14
14
  bindir: bin
15
15
  cert_chain: []
16
16
 
17
- date: 2010-08-31 00:00:00 -04:00
17
+ date: 2010-10-11 00:00:00 -04:00
18
18
  default_executable:
19
19
  dependencies:
20
20
  - !ruby/object:Gem::Dependency
@@ -117,8 +117,8 @@ dependencies:
117
117
  segments:
118
118
  - 0
119
119
  - 8
120
- - 0
121
- version: 0.8.0
120
+ - 1
121
+ version: 0.8.1
122
122
  type: :runtime
123
123
  version_requirements: *id007
124
124
  - !ruby/object:Gem::Dependency
@@ -153,6 +153,9 @@ files:
153
153
  - spec/ripple_session_store_spec.rb
154
154
  - spec/spec_helper.rb
155
155
  - spec/support/ripple_session_support.rb
156
+ - spec/support/rspec-rails-neuter.rb
157
+ - spec/support/test_server.rb
158
+ - spec/support/test_server.yml
156
159
  has_rdoc: true
157
160
  homepage: http://seancribbs.github.com/ripple
158
161
  licenses: []
@@ -191,3 +194,5 @@ test_files:
191
194
  - spec/ripple_session_store_spec.rb
192
195
  - spec/spec_helper.rb
193
196
  - spec/support/ripple_session_support.rb
197
+ - spec/support/rspec-rails-neuter.rb
198
+ - spec/support/test_server.rb