mosquito 0.1.1 → 0.1.2
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGELOG +2 -0
- data/Rakefile +1 -1
- data/lib/mosquito.rb +9 -1
- data/public/blog/controllers.rb +9 -0
- data/test/test_blog.rb +9 -0
- metadata +4 -4
data/CHANGELOG
CHANGED
data/Rakefile
CHANGED
@@ -9,5 +9,5 @@ Hoe.new('Mosquito', Mosquito::VERSION) do |p|
|
|
9
9
|
p.email = 'boss@topfunky.com'
|
10
10
|
p.summary = "A Camping test library."
|
11
11
|
p.url = "http://mosquito.rubyforge.org"
|
12
|
-
p.extra_deps = ['
|
12
|
+
p.extra_deps = ['activerecord', 'activesupport', 'camping']
|
13
13
|
end
|
data/lib/mosquito.rb
CHANGED
@@ -5,17 +5,19 @@ active_record
|
|
5
5
|
active_record/fixtures
|
6
6
|
active_support/binding_of_caller
|
7
7
|
camping
|
8
|
+
camping/session
|
8
9
|
fileutils
|
9
10
|
stringio
|
10
11
|
cgi
|
11
12
|
).each { |lib| require lib }
|
12
13
|
|
13
14
|
module Mosquito
|
14
|
-
VERSION = '0.1.
|
15
|
+
VERSION = '0.1.2'
|
15
16
|
end
|
16
17
|
|
17
18
|
ActiveRecord::Base.establish_connection(:adapter => 'sqlite3', :database => ":memory:")
|
18
19
|
ActiveRecord::Base.logger = Logger.new("test/test.log")
|
20
|
+
Camping::Models::Session.create_schema
|
19
21
|
|
20
22
|
Test::Unit::TestCase.fixture_path = "test/fixtures/"
|
21
23
|
|
@@ -166,6 +168,12 @@ module Camping
|
|
166
168
|
res[name] = value
|
167
169
|
res
|
168
170
|
end
|
171
|
+
|
172
|
+
@cookies = H[@cookies]
|
173
|
+
|
174
|
+
session = Camping::Models::Session.persist @cookies
|
175
|
+
app = @class_name_abbr.gsub(/^(\w+)::.+$/, '\1')
|
176
|
+
@state = (session[app] ||= Camping::H[])
|
169
177
|
|
170
178
|
if @response.headers['X-Sendfile']
|
171
179
|
@response.body = File.read(@response.headers['X-Sendfile'])
|
data/public/blog/controllers.rb
CHANGED
@@ -79,6 +79,15 @@ module Blog::Controllers
|
|
79
79
|
render :login
|
80
80
|
end
|
81
81
|
end
|
82
|
+
|
83
|
+
class Cookies < R '/cookies'
|
84
|
+
def get
|
85
|
+
@cookies.awesome_cookie = 'camping for good'
|
86
|
+
@state.awesome_data = 'camping for good'
|
87
|
+
@posts = Post.find(:all)
|
88
|
+
render :index
|
89
|
+
end
|
90
|
+
end
|
82
91
|
|
83
92
|
class Logout
|
84
93
|
def get
|
data/test/test_blog.rb
CHANGED
@@ -13,10 +13,19 @@ class TestBlog < Camping::FunctionalTest
|
|
13
13
|
# Do other stuff here
|
14
14
|
end
|
15
15
|
|
16
|
+
def test_cookies
|
17
|
+
get '/cookies'
|
18
|
+
assert_cookie 'awesome_cookie', 'camping+for+good'
|
19
|
+
assert_equal @state.awesome_data, 'camping for good'
|
20
|
+
get '/'
|
21
|
+
assert_equal @state.awesome_data, 'camping for good'
|
22
|
+
end
|
23
|
+
|
16
24
|
def test_index
|
17
25
|
get
|
18
26
|
assert_response :success
|
19
27
|
assert_match_body %r!>blog<!
|
28
|
+
assert_not_equal @state.awesome_data, 'camping for good'
|
20
29
|
end
|
21
30
|
|
22
31
|
def test_view
|
metadata
CHANGED
@@ -3,8 +3,8 @@ rubygems_version: 0.9.0
|
|
3
3
|
specification_version: 1
|
4
4
|
name: mosquito
|
5
5
|
version: !ruby/object:Gem::Version
|
6
|
-
version: 0.1.
|
7
|
-
date:
|
6
|
+
version: 0.1.2
|
7
|
+
date: 2007-01-07 00:00:00 -08:00
|
8
8
|
summary: A Camping test library.
|
9
9
|
require_paths:
|
10
10
|
- lib
|
@@ -65,7 +65,7 @@ requirements: []
|
|
65
65
|
|
66
66
|
dependencies:
|
67
67
|
- !ruby/object:Gem::Dependency
|
68
|
-
name:
|
68
|
+
name: activerecord
|
69
69
|
version_requirement:
|
70
70
|
version_requirements: !ruby/object:Gem::Version::Requirement
|
71
71
|
requirements:
|
@@ -74,7 +74,7 @@ dependencies:
|
|
74
74
|
version: 0.0.0
|
75
75
|
version:
|
76
76
|
- !ruby/object:Gem::Dependency
|
77
|
-
name:
|
77
|
+
name: activesupport
|
78
78
|
version_requirement:
|
79
79
|
version_requirements: !ruby/object:Gem::Version::Requirement
|
80
80
|
requirements:
|