strelka 0.0.1.pre.244 → 0.0.1.pre.252
Sign up to get free protection for your applications and to get access to all the features.
- data.tar.gz.sig +0 -0
- data/ChangeLog +57 -3
- data/Manifest.txt +3 -4
- data/Rakefile +1 -1
- data/bin/strelka +4 -7
- data/examples/.env +4 -0
- data/examples/Procfile +8 -0
- data/examples/apps/auth-demo +3 -5
- data/examples/apps/auth-demo2 +10 -9
- data/{data/strelka → examples}/apps/hello-world +1 -2
- data/examples/apps/sessions-demo +2 -2
- data/examples/config.yml +12 -1
- data/examples/gen-config.rb +5 -6
- data/examples/templates/auth-form.tmpl +4 -0
- data/examples/templates/auth-success.tmpl +3 -1
- data/lib/strelka.rb +15 -21
- data/lib/strelka/app.rb +53 -31
- data/lib/strelka/app/auth.rb +260 -132
- data/lib/strelka/app/sessions.rb +25 -31
- data/lib/strelka/authprovider/basic.rb +33 -9
- data/lib/strelka/authprovider/hostaccess.rb +1 -1
- data/lib/strelka/constants.rb +0 -11
- data/lib/strelka/cookie.rb +17 -1
- data/lib/strelka/httpresponse/negotiation.rb +1 -1
- data/lib/strelka/session/db.rb +49 -25
- data/lib/strelka/session/default.rb +39 -19
- data/spec/lib/helpers.rb +3 -24
- data/spec/strelka/app/auth_spec.rb +461 -177
- data/spec/strelka/app/sessions_spec.rb +7 -26
- data/spec/strelka/app_spec.rb +3 -3
- data/spec/strelka/authprovider/basic_spec.rb +4 -4
- data/spec/strelka/httprequest/session_spec.rb +1 -1
- data/spec/strelka/httpresponse/session_spec.rb +1 -1
- data/spec/strelka/session/db_spec.rb +6 -1
- data/spec/strelka/session/default_spec.rb +3 -3
- metadata +7 -8
- metadata.gz.sig +2 -2
- data/examples/apps/ws-echo +0 -17
- data/lib/strelka/logging.rb +0 -301
- data/spec/strelka/logging_spec.rb +0 -74
@@ -1,74 +0,0 @@
|
|
1
|
-
# -*- ruby -*-
|
2
|
-
# vim: set nosta noet ts=4 sw=4:
|
3
|
-
# encoding: utf-8
|
4
|
-
|
5
|
-
BEGIN {
|
6
|
-
require 'pathname'
|
7
|
-
basedir = Pathname.new( __FILE__ ).dirname.parent.parent
|
8
|
-
$LOAD_PATH.unshift( basedir ) unless $LOAD_PATH.include?( basedir )
|
9
|
-
}
|
10
|
-
|
11
|
-
require 'rspec'
|
12
|
-
require 'stringio'
|
13
|
-
|
14
|
-
require 'spec/lib/helpers'
|
15
|
-
|
16
|
-
require 'strelka'
|
17
|
-
require 'strelka/logging'
|
18
|
-
|
19
|
-
|
20
|
-
#####################################################################
|
21
|
-
### C O N T E X T S
|
22
|
-
#####################################################################
|
23
|
-
|
24
|
-
describe Strelka::Logging, "-extended module" do
|
25
|
-
|
26
|
-
before( :each ) do
|
27
|
-
@extended_module = Module.new do
|
28
|
-
extend Strelka::Logging
|
29
|
-
end
|
30
|
-
end
|
31
|
-
|
32
|
-
it "should have a default Logger" do
|
33
|
-
@extended_module.logger.should be_a( Logger )
|
34
|
-
@extended_module.default_logger.should equal( @extended_module.logger )
|
35
|
-
end
|
36
|
-
|
37
|
-
it "should know if its default logger is replaced" do
|
38
|
-
@extended_module.should be_using_default_logger
|
39
|
-
@extended_module.logger = Logger.new( $stderr )
|
40
|
-
@extended_module.should_not be_using_default_logger
|
41
|
-
end
|
42
|
-
|
43
|
-
it "has the default logger instance after being reset" do
|
44
|
-
@extended_module.reset_logger
|
45
|
-
@extended_module.logger.should equal( @extended_module.default_logger )
|
46
|
-
end
|
47
|
-
|
48
|
-
it "has the default log formatter instance after being reset" do
|
49
|
-
@extended_module.reset_logger
|
50
|
-
@extended_module.logger.formatter.should equal( @extended_module.default_log_formatter )
|
51
|
-
end
|
52
|
-
|
53
|
-
|
54
|
-
context "with new defaults" do
|
55
|
-
|
56
|
-
before( :each ) do
|
57
|
-
@sink = StringIO.new
|
58
|
-
@logger = Logger.new( @sink )
|
59
|
-
@formatter = Strelka::Logging::ColorFormatter.new( @logger )
|
60
|
-
|
61
|
-
@extended_module.default_logger = @logger
|
62
|
-
@extended_module.default_log_formatter = @formatter
|
63
|
-
end
|
64
|
-
|
65
|
-
it "uses the new defaults when the logging subsystem is reset" do
|
66
|
-
@extended_module.reset_logger
|
67
|
-
@extended_module.logger.should equal( @logger )
|
68
|
-
end
|
69
|
-
|
70
|
-
end
|
71
|
-
|
72
|
-
|
73
|
-
end
|
74
|
-
|