strelka 0.15.0 → 0.16.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- checksums.yaml.gz.sig +0 -0
- data.tar.gz.sig +0 -0
- data/ChangeLog +3293 -3058
- data/History.rdoc +17 -0
- data/Manifest.txt +3 -0
- data/Rakefile +2 -2
- data/contrib/hoetemplate/lib/file_name.rb.erb +3 -2
- data/contrib/hoetemplate/spec/file_name_spec.rb.erb +1 -1
- data/examples/apps/auth-demo +1 -2
- data/examples/apps/auth-demo2 +1 -2
- data/examples/apps/sessions-demo +1 -2
- data/examples/gen-config.rb +1 -2
- data/lib/strelka.rb +92 -17
- data/lib/strelka/app.rb +7 -6
- data/lib/strelka/app/auth.rb +5 -5
- data/lib/strelka/app/errors.rb +1 -1
- data/lib/strelka/app/filters.rb +1 -1
- data/lib/strelka/app/negotiation.rb +1 -1
- data/lib/strelka/app/parameters.rb +1 -1
- data/lib/strelka/app/restresources.rb +14 -21
- data/lib/strelka/app/routing.rb +5 -6
- data/lib/strelka/app/sessions.rb +3 -1
- data/lib/strelka/app/templating.rb +1 -1
- data/lib/strelka/authprovider.rb +1 -1
- data/lib/strelka/authprovider/basic.rb +1 -0
- data/lib/strelka/authprovider/hostaccess.rb +1 -0
- data/lib/strelka/behavior/plugin.rb +2 -2
- data/lib/strelka/cli.rb +2 -1
- data/lib/strelka/command/config.rb +2 -1
- data/lib/strelka/command/discover.rb +2 -1
- data/lib/strelka/command/start.rb +2 -1
- data/lib/strelka/constants.rb +1 -1
- data/lib/strelka/cookie.rb +1 -1
- data/lib/strelka/cookieset.rb +1 -1
- data/lib/strelka/discovery.rb +1 -1
- data/lib/strelka/httprequest.rb +4 -4
- data/lib/strelka/httprequest/acceptparams.rb +1 -1
- data/lib/strelka/httprequest/auth.rb +3 -1
- data/lib/strelka/httprequest/negotiation.rb +1 -1
- data/lib/strelka/httprequest/session.rb +3 -1
- data/lib/strelka/httpresponse.rb +2 -3
- data/lib/strelka/httpresponse/negotiation.rb +1 -1
- data/lib/strelka/httpresponse/session.rb +1 -1
- data/lib/strelka/mixins.rb +26 -5
- data/lib/strelka/multipartparser.rb +3 -3
- data/lib/strelka/paramvalidator.rb +4 -4
- data/lib/strelka/plugins.rb +14 -5
- data/lib/strelka/router.rb +1 -1
- data/lib/strelka/router/default.rb +1 -1
- data/lib/strelka/router/exclusive.rb +1 -1
- data/lib/strelka/session.rb +1 -0
- data/lib/strelka/session/db.rb +1 -0
- data/lib/strelka/session/default.rb +1 -0
- data/lib/strelka/testing.rb +454 -14
- data/lib/strelka/websocketserver.rb +150 -36
- data/lib/strelka/websocketserver/heartbeat.rb +163 -0
- data/lib/strelka/websocketserver/routing.rb +46 -19
- data/spec/constants.rb +1 -1
- data/spec/helpers.rb +15 -6
- data/spec/strelka/app/auth_spec.rb +5 -3
- data/spec/strelka/app/errors_spec.rb +2 -2
- data/spec/strelka/app/filters_spec.rb +2 -2
- data/spec/strelka/app/negotiation_spec.rb +2 -2
- data/spec/strelka/app/parameters_spec.rb +5 -5
- data/spec/strelka/app/restresources_spec.rb +8 -6
- data/spec/strelka/app/routing_spec.rb +3 -3
- data/spec/strelka/app/sessions_spec.rb +4 -2
- data/spec/strelka/app/templating_spec.rb +2 -2
- data/spec/strelka/app_spec.rb +5 -24
- data/spec/strelka/authprovider/basic_spec.rb +3 -2
- data/spec/strelka/authprovider/hostaccess_spec.rb +3 -2
- data/spec/strelka/authprovider_spec.rb +3 -2
- data/spec/strelka/cli_spec.rb +7 -4
- data/spec/strelka/cookie_spec.rb +2 -2
- data/spec/strelka/cookieset_spec.rb +2 -2
- data/spec/strelka/discovery_spec.rb +2 -2
- data/spec/strelka/exceptions_spec.rb +2 -2
- data/spec/strelka/httprequest/acceptparams_spec.rb +2 -2
- data/spec/strelka/httprequest/auth_spec.rb +3 -2
- data/spec/strelka/httprequest/negotiation_spec.rb +2 -2
- data/spec/strelka/httprequest/session_spec.rb +3 -2
- data/spec/strelka/httprequest_spec.rb +7 -2
- data/spec/strelka/httpresponse/negotiation_spec.rb +6 -5
- data/spec/strelka/httpresponse/session_spec.rb +3 -2
- data/spec/strelka/httpresponse_spec.rb +4 -3
- data/spec/strelka/mixins_spec.rb +85 -2
- data/spec/strelka/multipartparser_spec.rb +5 -4
- data/spec/strelka/paramvalidator_spec.rb +15 -10
- data/spec/strelka/plugins_spec.rb +24 -2
- data/spec/strelka/router/default_spec.rb +2 -2
- data/spec/strelka/router/exclusive_spec.rb +2 -2
- data/spec/strelka/router_spec.rb +2 -2
- data/spec/strelka/session/db_spec.rb +3 -2
- data/spec/strelka/session/default_spec.rb +3 -2
- data/spec/strelka/session_spec.rb +3 -2
- data/spec/strelka/testing_spec.rb +772 -0
- data/spec/strelka/websocketserver/heartbeat_spec.rb +19 -0
- data/spec/strelka/websocketserver/routing_spec.rb +31 -29
- data/spec/strelka/websocketserver_spec.rb +210 -75
- data/spec/strelka_spec.rb +172 -2
- metadata +43 -36
- metadata.gz.sig +0 -0
data/spec/constants.rb
CHANGED
data/spec/helpers.rb
CHANGED
@@ -1,13 +1,15 @@
|
|
1
|
-
|
2
|
-
#
|
1
|
+
# -*- ruby -*-
|
2
|
+
# vim: set nosta noet ts=4 sw=4:
|
3
|
+
# frozen-string-literal: true
|
3
4
|
|
4
5
|
BEGIN {
|
5
6
|
require 'pathname'
|
6
|
-
basedir = Pathname.new( __FILE__ ).dirname.parent
|
7
|
+
basedir = Pathname.new( __FILE__ ).dirname.parent
|
7
8
|
|
8
9
|
srcdir = basedir.parent
|
9
10
|
mongrel2dir = srcdir + 'Mongrel2/lib'
|
10
11
|
|
12
|
+
$stderr.puts "Adding %s to the LOAD_PATH..." % [ mongrel2dir ]
|
11
13
|
$LOAD_PATH.unshift( mongrel2dir.to_s ) unless
|
12
14
|
!mongrel2dir.directory? || $LOAD_PATH.include?( mongrel2dir.to_s )
|
13
15
|
}
|
@@ -104,13 +106,20 @@ end
|
|
104
106
|
RSpec.configure do |config|
|
105
107
|
include Strelka::TestConstants
|
106
108
|
|
107
|
-
config.run_all_when_everything_filtered = true
|
108
|
-
config.filter_run :focus
|
109
|
-
config.order = 'random'
|
110
109
|
config.mock_with( :rspec ) do |mock|
|
111
110
|
mock.syntax = :expect
|
112
111
|
end
|
113
112
|
|
113
|
+
config.disable_monkey_patching!
|
114
|
+
config.example_status_persistence_file_path = "spec/.status"
|
115
|
+
config.filter_run :focus
|
116
|
+
config.filter_run_when_matching :focus
|
117
|
+
config.order = :random
|
118
|
+
config.profile_examples = 5
|
119
|
+
config.run_all_when_everything_filtered = true
|
120
|
+
config.shared_context_metadata_behavior = :apply_to_host_groups
|
121
|
+
# config.warnings = true
|
122
|
+
|
114
123
|
config.extend( Strelka::TestConstants )
|
115
124
|
|
116
125
|
config.include( Loggability::SpecHelpers )
|
@@ -1,4 +1,6 @@
|
|
1
|
-
|
1
|
+
# -*- ruby -*-
|
2
|
+
# vim: set nosta noet ts=4 sw=4:
|
3
|
+
# frozen-string-literal: true
|
2
4
|
|
3
5
|
require_relative '../../helpers'
|
4
6
|
|
@@ -17,7 +19,7 @@ require 'strelka/behavior/plugin'
|
|
17
19
|
### C O N T E X T S
|
18
20
|
#####################################################################
|
19
21
|
|
20
|
-
describe Strelka::App::Auth do
|
22
|
+
RSpec.describe Strelka::App::Auth do
|
21
23
|
|
22
24
|
before( :all ) do
|
23
25
|
@request_factory = Mongrel2::RequestFactory.new( route: '/api/v1' )
|
@@ -310,7 +312,7 @@ describe Strelka::App::Auth do
|
|
310
312
|
|
311
313
|
req = @request_factory.get( '/api/v1/foom' )
|
312
314
|
expect( app.request_should_auth?(req) ).to be_truthy()
|
313
|
-
req = @request_factory.post( '/api/v1/foom', :accept => 'text/plain, text/html; q=0.5' )
|
315
|
+
req = @request_factory.post( '/api/v1/foom', '', :accept => 'text/plain, text/html; q=0.5' )
|
314
316
|
expect( app.request_should_auth?(req) ).to be_truthy()
|
315
317
|
req = @request_factory.get( '/api/v1/foom', :accept => 'text/plain, text/html; q=0.5' )
|
316
318
|
expect( app.request_should_auth?(req) ).to be_falsey()
|
@@ -1,6 +1,6 @@
|
|
1
1
|
# -*- ruby -*-
|
2
2
|
# vim: set nosta noet ts=4 sw=4:
|
3
|
-
#
|
3
|
+
# frozen-string-literal: true
|
4
4
|
|
5
5
|
require_relative '../../helpers'
|
6
6
|
|
@@ -18,7 +18,7 @@ require 'strelka/behavior/plugin'
|
|
18
18
|
### C O N T E X T S
|
19
19
|
#####################################################################
|
20
20
|
|
21
|
-
describe Strelka::App::Errors do
|
21
|
+
RSpec.describe Strelka::App::Errors do
|
22
22
|
|
23
23
|
before( :all ) do
|
24
24
|
@request_factory = Mongrel2::RequestFactory.new( route: '' )
|
@@ -1,6 +1,6 @@
|
|
1
1
|
# -*- ruby -*-
|
2
2
|
# vim: set nosta noet ts=4 sw=4:
|
3
|
-
#
|
3
|
+
# frozen-string-literal: true
|
4
4
|
|
5
5
|
require_relative '../../helpers'
|
6
6
|
|
@@ -17,7 +17,7 @@ require 'strelka/behavior/plugin'
|
|
17
17
|
### C O N T E X T S
|
18
18
|
#####################################################################
|
19
19
|
|
20
|
-
describe Strelka::App::Filters do
|
20
|
+
RSpec.describe Strelka::App::Filters do
|
21
21
|
|
22
22
|
before( :all ) do
|
23
23
|
@request_factory = Mongrel2::RequestFactory.new( route: '' )
|
@@ -1,6 +1,6 @@
|
|
1
1
|
# -*- ruby -*-
|
2
2
|
# vim: set nosta noet ts=4 sw=4:
|
3
|
-
#
|
3
|
+
# frozen-string-literal: true
|
4
4
|
|
5
5
|
require_relative '../../helpers'
|
6
6
|
|
@@ -16,7 +16,7 @@ require 'strelka/behavior/plugin'
|
|
16
16
|
### C O N T E X T S
|
17
17
|
#####################################################################
|
18
18
|
|
19
|
-
describe Strelka::App::Negotiation do
|
19
|
+
RSpec.describe Strelka::App::Negotiation do
|
20
20
|
|
21
21
|
|
22
22
|
before( :all ) do
|
@@ -1,6 +1,6 @@
|
|
1
1
|
# -*- ruby -*-
|
2
2
|
# vim: set nosta noet ts=4 sw=4:
|
3
|
-
#
|
3
|
+
# frozen-string-literal: true
|
4
4
|
|
5
5
|
require_relative '../../helpers'
|
6
6
|
|
@@ -16,7 +16,7 @@ require 'strelka/behavior/plugin'
|
|
16
16
|
### C O N T E X T S
|
17
17
|
#####################################################################
|
18
18
|
|
19
|
-
describe Strelka::App::Parameters do
|
19
|
+
RSpec.describe Strelka::App::Parameters do
|
20
20
|
|
21
21
|
before( :all ) do
|
22
22
|
@request_factory = Mongrel2::RequestFactory.new( route: '/user' )
|
@@ -119,7 +119,7 @@ describe Strelka::App::Parameters do
|
|
119
119
|
end
|
120
120
|
|
121
121
|
it "validates parameters from the request" do
|
122
|
-
req = @request_factory.get( '/user/search?username=anheptoh'.taint )
|
122
|
+
req = @request_factory.get( (+'/user/search?username=anheptoh').taint )
|
123
123
|
@app.new.handle( req )
|
124
124
|
|
125
125
|
expect( req.params ).to be_a( Strelka::ParamValidator )
|
@@ -135,7 +135,7 @@ describe Strelka::App::Parameters do
|
|
135
135
|
end
|
136
136
|
|
137
137
|
expect( @app.untaint_all_constraints ).to be_truthy()
|
138
|
-
req = @request_factory.get( '/user/search?username=shereshnaheth'.taint )
|
138
|
+
req = @request_factory.get( (+'/user/search?username=shereshnaheth').taint )
|
139
139
|
@app.new.handle( req )
|
140
140
|
|
141
141
|
expect( req.params[:username] ).to eq( 'shereshnaheth' )
|
@@ -147,7 +147,7 @@ describe Strelka::App::Parameters do
|
|
147
147
|
param :message, :printable, :untaint
|
148
148
|
end
|
149
149
|
|
150
|
-
req = @request_factory.get( '/user/search?message=I+love+the+circus.'.taint )
|
150
|
+
req = @request_factory.get( (+'/user/search?message=I+love+the+circus.').taint )
|
151
151
|
@app.new.handle( req )
|
152
152
|
|
153
153
|
expect( req.params[:message] ).to_not be_tainted()
|
@@ -1,6 +1,6 @@
|
|
1
1
|
# -*- ruby -*-
|
2
2
|
# vim: set nosta noet ts=4 sw=4:
|
3
|
-
#
|
3
|
+
# frozen-string-literal: true
|
4
4
|
|
5
5
|
require_relative '../../helpers'
|
6
6
|
|
@@ -18,7 +18,7 @@ require 'mongrel2/config/dsl'
|
|
18
18
|
### C O N T E X T S
|
19
19
|
#####################################################################
|
20
20
|
|
21
|
-
describe Strelka::App::RestResources do
|
21
|
+
RSpec.describe Strelka::App::RestResources do
|
22
22
|
include Mongrel2::Config::DSL
|
23
23
|
|
24
24
|
before( :all ) do
|
@@ -32,8 +32,12 @@ describe Strelka::App::RestResources do
|
|
32
32
|
return self.filter( name: name )
|
33
33
|
end
|
34
34
|
end
|
35
|
-
Mongrel2::Config::Server.subset( :with_ephemeral_ports ) { port > 1024 }
|
36
35
|
Mongrel2::Config::Server.dataset_module( name_selection )
|
36
|
+
Mongrel2::Config::Server.dataset_module do
|
37
|
+
def with_ephemeral_ports
|
38
|
+
return self.where { port > 1024 }
|
39
|
+
end
|
40
|
+
end
|
37
41
|
end
|
38
42
|
|
39
43
|
|
@@ -287,7 +291,7 @@ describe Strelka::App::RestResources do
|
|
287
291
|
expect( body.first['uuid'] ).to eq( 'test-server' )
|
288
292
|
end
|
289
293
|
|
290
|
-
it "has a GET route for fetching the resource via a
|
294
|
+
it "has a GET route for fetching the resource via a dataset module method" do
|
291
295
|
req = @request_factory.get( '/api/v1/servers/with_ephemeral_ports',
|
292
296
|
:accept => 'application/json' )
|
293
297
|
res = @app.new.handle( req )
|
@@ -407,8 +411,6 @@ describe Strelka::App::RestResources do
|
|
407
411
|
expect( server.uuid ).to eq( @server_values['uuid'] )
|
408
412
|
end
|
409
413
|
|
410
|
-
it "ignores attributes that aren't in the allowed columns list"
|
411
|
-
|
412
414
|
end # POST routes
|
413
415
|
|
414
416
|
|
@@ -1,6 +1,6 @@
|
|
1
1
|
# -*- ruby -*-
|
2
2
|
# vim: set nosta noet ts=4 sw=4:
|
3
|
-
#
|
3
|
+
# frozen-string-literal: true
|
4
4
|
|
5
5
|
require_relative '../../helpers'
|
6
6
|
|
@@ -17,7 +17,7 @@ require 'strelka/behavior/plugin'
|
|
17
17
|
### C O N T E X T S
|
18
18
|
#####################################################################
|
19
19
|
|
20
|
-
describe Strelka::App::Routing do
|
20
|
+
RSpec.describe Strelka::App::Routing do
|
21
21
|
|
22
22
|
before( :all ) do
|
23
23
|
@request_factory = Mongrel2::RequestFactory.new( route: '' )
|
@@ -51,7 +51,7 @@ describe Strelka::App::Routing do
|
|
51
51
|
options( '/clowns' ) {}
|
52
52
|
end
|
53
53
|
|
54
|
-
expect( @app.route_methods ).to
|
54
|
+
expect( @app.route_methods ).to include( :GET, :POST_clowns, :OPTIONS_clowns )
|
55
55
|
end
|
56
56
|
|
57
57
|
# OPTIONS GET/HEAD POST PUT DELETE TRACE CONNECT
|
@@ -1,4 +1,6 @@
|
|
1
|
-
|
1
|
+
# -*- ruby -*-
|
2
|
+
# vim: set nosta noet ts=4 sw=4:
|
3
|
+
# frozen-string-literal: true
|
2
4
|
|
3
5
|
require_relative '../../helpers'
|
4
6
|
|
@@ -15,7 +17,7 @@ require 'strelka/behavior/plugin'
|
|
15
17
|
### C O N T E X T S
|
16
18
|
#####################################################################
|
17
19
|
|
18
|
-
describe Strelka::App::Sessions do
|
20
|
+
RSpec.describe Strelka::App::Sessions do
|
19
21
|
|
20
22
|
before( :all ) do
|
21
23
|
@request_factory = Mongrel2::RequestFactory.new( route: '' )
|
@@ -1,6 +1,6 @@
|
|
1
1
|
# -*- ruby -*-
|
2
2
|
# vim: set nosta noet ts=4 sw=4:
|
3
|
-
#
|
3
|
+
# frozen-string-literal: true
|
4
4
|
|
5
5
|
require_relative '../../helpers'
|
6
6
|
|
@@ -18,7 +18,7 @@ require 'strelka/behavior/plugin'
|
|
18
18
|
### C O N T E X T S
|
19
19
|
#####################################################################
|
20
20
|
|
21
|
-
describe Strelka::App::Templating do
|
21
|
+
RSpec.describe Strelka::App::Templating do
|
22
22
|
|
23
23
|
before( :all ) do
|
24
24
|
@request_factory = Mongrel2::RequestFactory.new( route: '/user' )
|
data/spec/strelka/app_spec.rb
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
# -*- ruby -*-
|
2
2
|
# vim: set nosta noet ts=4 sw=4:
|
3
|
-
#
|
3
|
+
# frozen-string-literal: true
|
4
4
|
|
5
5
|
require_relative '../helpers'
|
6
6
|
|
@@ -15,7 +15,7 @@ require 'strelka/app'
|
|
15
15
|
### C O N T E X T S
|
16
16
|
#####################################################################
|
17
17
|
|
18
|
-
describe Strelka::App do
|
18
|
+
RSpec.describe Strelka::App do
|
19
19
|
|
20
20
|
before( :all ) do
|
21
21
|
@initial_registry = Strelka::App.loaded_plugins.dup
|
@@ -207,35 +207,16 @@ describe Strelka::App do
|
|
207
207
|
|
208
208
|
it "uses the app's ID constant for the appid if .run is called without one" do
|
209
209
|
@app.const_set( :ID, 'testing-app' )
|
210
|
-
|
211
|
-
allow( conn ).to receive( :request_sock )
|
212
|
-
allow( CZTop::Poller ).to receive( :new )
|
213
|
-
|
214
|
-
expect( Mongrel2::Handler ).to receive( :connection_info_for ).with( 'testing-app' ).
|
215
|
-
and_return([ TEST_SEND_SPEC, TEST_RECV_SPEC ])
|
216
|
-
expect( Mongrel2::Connection ).to receive( :new ).
|
217
|
-
with( 'testing-app', TEST_SEND_SPEC, TEST_RECV_SPEC ).
|
218
|
-
and_return( conn )
|
219
|
-
|
220
|
-
@app.run
|
210
|
+
expect( @app.default_appid ).to eq( 'testing-app' )
|
221
211
|
end
|
222
212
|
|
223
213
|
|
224
|
-
it "uses the app's name for the appid
|
214
|
+
it "uses the app's name for the appid it has no ID constant" do
|
225
215
|
@app.class_eval do
|
226
216
|
def self::name; "My::First::Blog" ; end
|
227
217
|
end
|
228
|
-
conn = double( "Mongrel2 connection", close: true )
|
229
|
-
allow( conn ).to receive( :request_sock )
|
230
|
-
allow( CZTop::Poller ).to receive( :new )
|
231
|
-
|
232
|
-
expect( Mongrel2::Handler ).to receive( :connection_info_for ).with( 'my-first-blog' ).
|
233
|
-
and_return([ TEST_SEND_SPEC, TEST_RECV_SPEC ])
|
234
|
-
expect( Mongrel2::Connection ).to receive( :new ).
|
235
|
-
with( 'my-first-blog', TEST_SEND_SPEC, TEST_RECV_SPEC ).
|
236
|
-
and_return( conn )
|
237
218
|
|
238
|
-
@app.
|
219
|
+
expect( @app.default_appid ).to eq( 'my-first-blog' )
|
239
220
|
end
|
240
221
|
|
241
222
|
|
@@ -1,5 +1,6 @@
|
|
1
|
-
# -*-
|
1
|
+
# -*- ruby -*-
|
2
2
|
# vim: set nosta noet ts=4 sw=4:
|
3
|
+
# frozen-string-literal: true
|
3
4
|
|
4
5
|
require_relative '../../helpers'
|
5
6
|
|
@@ -14,7 +15,7 @@ require 'strelka/authprovider/basic'
|
|
14
15
|
### C O N T E X T S
|
15
16
|
#####################################################################
|
16
17
|
|
17
|
-
describe Strelka::AuthProvider::Basic do
|
18
|
+
RSpec.describe Strelka::AuthProvider::Basic do
|
18
19
|
|
19
20
|
before( :all ) do
|
20
21
|
@request_factory = Mongrel2::RequestFactory.new( route: '/admin' )
|
@@ -1,5 +1,6 @@
|
|
1
|
-
# -*-
|
1
|
+
# -*- ruby -*-
|
2
2
|
# vim: set nosta noet ts=4 sw=4:
|
3
|
+
# frozen-string-literal: true
|
3
4
|
|
4
5
|
require_relative '../../helpers'
|
5
6
|
|
@@ -14,7 +15,7 @@ require 'strelka/authprovider/hostaccess'
|
|
14
15
|
### C O N T E X T S
|
15
16
|
#####################################################################
|
16
17
|
|
17
|
-
describe Strelka::AuthProvider::HostAccess do
|
18
|
+
RSpec.describe Strelka::AuthProvider::HostAccess do
|
18
19
|
|
19
20
|
before( :all ) do
|
20
21
|
@request_factory = Mongrel2::RequestFactory.new( route: '/admin' )
|
@@ -1,5 +1,6 @@
|
|
1
|
-
# -*-
|
1
|
+
# -*- ruby -*-
|
2
2
|
# vim: set nosta noet ts=4 sw=4:
|
3
|
+
# frozen-string-literal: true
|
3
4
|
|
4
5
|
require_relative '../helpers'
|
5
6
|
|
@@ -13,7 +14,7 @@ require 'strelka/authprovider'
|
|
13
14
|
### C O N T E X T S
|
14
15
|
#####################################################################
|
15
16
|
|
16
|
-
describe Strelka::AuthProvider do
|
17
|
+
RSpec.describe Strelka::AuthProvider do
|
17
18
|
|
18
19
|
before( :all ) do
|
19
20
|
@request_factory = Mongrel2::RequestFactory.new( route: '/admin' )
|
data/spec/strelka/cli_spec.rb
CHANGED
@@ -1,5 +1,6 @@
|
|
1
|
-
|
2
|
-
#
|
1
|
+
# -*- ruby -*-
|
2
|
+
# vim: set nosta noet ts=4 sw=4:
|
3
|
+
# frozen-string-literal: true
|
3
4
|
|
4
5
|
require_relative '../helpers'
|
5
6
|
|
@@ -8,7 +9,7 @@ require 'rspec'
|
|
8
9
|
|
9
10
|
require 'strelka/cli'
|
10
11
|
|
11
|
-
describe Strelka::CLI do
|
12
|
+
RSpec.describe Strelka::CLI do
|
12
13
|
|
13
14
|
before( :all ) do
|
14
15
|
testcommands = Module.new
|
@@ -75,7 +76,9 @@ describe Strelka::CLI do
|
|
75
76
|
|
76
77
|
it "doesn't execute the block if dry-run mode *is* enabled" do
|
77
78
|
expect {
|
78
|
-
|
79
|
+
Loggability.outputting_to( [] ) do
|
80
|
+
described_class.run([ '-n', 'test_dryrun' ])
|
81
|
+
end
|
79
82
|
}.to_not output( /Ran it!/ ).to_stdout
|
80
83
|
end
|
81
84
|
|
data/spec/strelka/cookie_spec.rb
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
# -*- ruby -*-
|
2
2
|
# vim: set nosta noet ts=4 sw=4:
|
3
|
-
#
|
3
|
+
# frozen-string-literal: true
|
4
4
|
|
5
5
|
require_relative '../helpers'
|
6
6
|
|
@@ -13,7 +13,7 @@ require 'strelka/cookie'
|
|
13
13
|
### C O N T E X T S
|
14
14
|
#####################################################################
|
15
15
|
|
16
|
-
describe Strelka::Cookie do
|
16
|
+
RSpec.describe Strelka::Cookie do
|
17
17
|
|
18
18
|
it "parses a 'nil' Cookie header field as an empty Hash" do
|
19
19
|
expect( Strelka::Cookie.parse( nil ) ).to eq( {} )
|
@@ -1,6 +1,6 @@
|
|
1
1
|
# -*- ruby -*-
|
2
2
|
# vim: set nosta noet ts=4 sw=4:
|
3
|
-
#
|
3
|
+
# frozen-string-literal: true
|
4
4
|
|
5
5
|
require_relative '../helpers'
|
6
6
|
|
@@ -14,7 +14,7 @@ require 'strelka/cookieset'
|
|
14
14
|
### C O N T E X T S
|
15
15
|
#####################################################################
|
16
16
|
|
17
|
-
describe Strelka::CookieSet do
|
17
|
+
RSpec.describe Strelka::CookieSet do
|
18
18
|
|
19
19
|
before( :each ) do
|
20
20
|
@cookieset = Strelka::CookieSet.new
|