sinatra-sessionography 0.1.0 → 0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/VERSION +1 -1
- data/sinatra-sessionography.gemspec +5 -3
- data/spec/base_spec.rb +44 -0
- metadata +5 -3
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.1.
|
1
|
+
0.1.1
|
@@ -5,11 +5,11 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = %q{sinatra-sessionography}
|
8
|
-
s.version = "0.1.
|
8
|
+
s.version = "0.1.1"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = ["Stephen Eley"]
|
12
|
-
s.date = %q{2010-04-
|
12
|
+
s.date = %q{2010-04-28}
|
13
13
|
s.description = %q{Sessionography has only one function: to replace Sinatra's session methods with a basic hash that persists across requests. Bypassing Rack::Session removes nearly all the complexity of unit and integration testing with session data.}
|
14
14
|
s.email = %q{sfeley@gmail.com}
|
15
15
|
s.extra_rdoc_files = [
|
@@ -25,6 +25,7 @@ Gem::Specification.new do |s|
|
|
25
25
|
"VERSION",
|
26
26
|
"lib/sinatra/sessionography.rb",
|
27
27
|
"sinatra-sessionography.gemspec",
|
28
|
+
"spec/base_spec.rb",
|
28
29
|
"spec/sessionography_spec.rb",
|
29
30
|
"spec/spec.opts",
|
30
31
|
"spec/spec_helper.rb"
|
@@ -35,7 +36,8 @@ Gem::Specification.new do |s|
|
|
35
36
|
s.rubygems_version = %q{1.3.6}
|
36
37
|
s.summary = %q{A simple sessions stub for testing Sinatra}
|
37
38
|
s.test_files = [
|
38
|
-
"spec/
|
39
|
+
"spec/base_spec.rb",
|
40
|
+
"spec/sessionography_spec.rb",
|
39
41
|
"spec/spec_helper.rb"
|
40
42
|
]
|
41
43
|
|
data/spec/base_spec.rb
ADDED
@@ -0,0 +1,44 @@
|
|
1
|
+
require File.dirname(__FILE__) + '/spec_helper'
|
2
|
+
|
3
|
+
class BaseApp < Sinatra::Base
|
4
|
+
helpers Sinatra::Sessionography
|
5
|
+
|
6
|
+
# Simple getter for testing
|
7
|
+
get '/session' do
|
8
|
+
session.inspect
|
9
|
+
end
|
10
|
+
|
11
|
+
# Simple setter for testing
|
12
|
+
post '/session' do
|
13
|
+
params.each{|k,v| session[k.to_sym] = (v.is_a?(String) ? v.to_sym : v)}
|
14
|
+
session.inspect
|
15
|
+
end
|
16
|
+
|
17
|
+
end
|
18
|
+
|
19
|
+
describe "Sinatra::Sessionography in a Sinatra::Base application" do
|
20
|
+
def app
|
21
|
+
BaseApp
|
22
|
+
end
|
23
|
+
|
24
|
+
before(:each) do
|
25
|
+
Sinatra::Sessionography.session = nil
|
26
|
+
end
|
27
|
+
|
28
|
+
it "returns a blank hash when not set" do
|
29
|
+
get '/session'
|
30
|
+
last_response.body.should == "{}"
|
31
|
+
end
|
32
|
+
|
33
|
+
it "can set a hash" do
|
34
|
+
post '/session', {:foo=>:bar}
|
35
|
+
last_response.body.should == "{:foo=>:bar}"
|
36
|
+
end
|
37
|
+
|
38
|
+
it "can remember what's posted" do
|
39
|
+
post '/session', {:hi=>:ho}
|
40
|
+
get '/session'
|
41
|
+
last_response.body.should == "{:hi=>:ho}"
|
42
|
+
end
|
43
|
+
|
44
|
+
end
|
metadata
CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
|
|
5
5
|
segments:
|
6
6
|
- 0
|
7
7
|
- 1
|
8
|
-
-
|
9
|
-
version: 0.1.
|
8
|
+
- 1
|
9
|
+
version: 0.1.1
|
10
10
|
platform: ruby
|
11
11
|
authors:
|
12
12
|
- Stephen Eley
|
@@ -14,7 +14,7 @@ autorequire:
|
|
14
14
|
bindir: bin
|
15
15
|
cert_chain: []
|
16
16
|
|
17
|
-
date: 2010-04-
|
17
|
+
date: 2010-04-28 00:00:00 -04:00
|
18
18
|
default_executable:
|
19
19
|
dependencies:
|
20
20
|
- !ruby/object:Gem::Dependency
|
@@ -74,6 +74,7 @@ files:
|
|
74
74
|
- VERSION
|
75
75
|
- lib/sinatra/sessionography.rb
|
76
76
|
- sinatra-sessionography.gemspec
|
77
|
+
- spec/base_spec.rb
|
77
78
|
- spec/sessionography_spec.rb
|
78
79
|
- spec/spec.opts
|
79
80
|
- spec/spec_helper.rb
|
@@ -108,5 +109,6 @@ signing_key:
|
|
108
109
|
specification_version: 3
|
109
110
|
summary: A simple sessions stub for testing Sinatra
|
110
111
|
test_files:
|
112
|
+
- spec/base_spec.rb
|
111
113
|
- spec/sessionography_spec.rb
|
112
114
|
- spec/spec_helper.rb
|