redis_web_manager 0.3.5 → 0.4.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -8,7 +8,7 @@ RSpec.describe RedisWebManager::Action do
8
8
  end
9
9
 
10
10
  let(:redis) do
11
- ::Redis.new
11
+ Redis.new
12
12
  end
13
13
 
14
14
  describe 'action' do
@@ -8,7 +8,6 @@ RSpec.describe RedisWebManager::Connection do
8
8
  end
9
9
 
10
10
  describe 'connection' do
11
-
12
11
  it 'returns a host' do
13
12
  expect(connection.host).to eql('127.0.0.1')
14
13
  end
@@ -28,6 +27,5 @@ RSpec.describe RedisWebManager::Connection do
28
27
  it 'returns a location' do
29
28
  expect(connection.location).to eql('127.0.0.1:6379')
30
29
  end
31
-
32
30
  end
33
31
  end
@@ -8,7 +8,7 @@ RSpec.describe RedisWebManager::Info do
8
8
  end
9
9
 
10
10
  let(:redis) do
11
- ::Redis.new
11
+ Redis.new
12
12
  end
13
13
 
14
14
  describe 'info' do
@@ -36,7 +36,7 @@ RSpec.describe RedisWebManager::Info do
36
36
  end
37
37
 
38
38
  it 'returns a memory usage value (memory_usage)' do
39
- expect(info.memory_usage('test')).to eql(52)
39
+ expect(info.memory_usage('test')).to be_between(52, 62)
40
40
  end
41
41
 
42
42
  it 'returns a test value (get)' do
@@ -40,7 +40,7 @@ RSpec.describe RedisWebManager do
40
40
  expect do
41
41
  RedisWebManager.configure do |c|
42
42
  c.redises = {
43
- default: ::Redis.new
43
+ default: Redis.new
44
44
  }
45
45
  c.lifespan = 1
46
46
  end
@@ -51,12 +51,24 @@ RSpec.describe RedisWebManager do
51
51
  expect do
52
52
  RedisWebManager.configure do |c|
53
53
  c.redises = {
54
- default: ::Redis.new
54
+ default: Redis.new
55
55
  }
56
56
  c.lifespan = -1.days
57
57
  end
58
58
  end.to raise_error(ArgumentError, 'Invalid lifespan, value must be greater than 0')
59
59
  end
60
60
 
61
+ it 'returns instances' do
62
+ RedisWebManager.configure do |c|
63
+ c.redises = {
64
+ foo: Redis.new,
65
+ bar: Redis.new
66
+ }
67
+ c.lifespan = 12.days
68
+ end
69
+
70
+ expect(RedisWebManager.redises.keys).to eql(%i[foo bar])
71
+ expect(RedisWebManager.redises.values.map(&:class)).to eql([Redis, Redis])
72
+ end
61
73
  end
62
74
  end
data/spec/spec_helper.rb CHANGED
@@ -10,7 +10,7 @@ require 'simplecov'
10
10
  require 'coveralls'
11
11
 
12
12
  SimpleCov.start
13
- #Coveralls.wear!
13
+ Coveralls.wear!
14
14
 
15
15
  # Given that it is always loaded, you are encouraged to keep this file as
16
16
  # light-weight as possible. Requiring heavyweight dependencies from this file
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: redis_web_manager
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.5
4
+ version: 0.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Boris BRESCIANI
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: exe
12
12
  cert_chain: []
13
- date: 2021-01-23 00:00:00.000000000 Z
13
+ date: 2021-08-13 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: coveralls
@@ -358,11 +358,6 @@ files:
358
358
  - spec/redis_web_manager_data_spec.rb
359
359
  - spec/redis_web_manager_info_spec.rb
360
360
  - spec/redis_web_manager_spec.rb
361
- - spec/routing/actions_controller_spec.rb
362
- - spec/routing/clients_controller_spec.rb
363
- - spec/routing/configuration_controller_spec.rb
364
- - spec/routing/dashboard_controller_spec.rb
365
- - spec/routing/keys_controller_spec.rb
366
361
  - spec/spec_helper.rb
367
362
  homepage: https://github.com/OpenGems/redis_web_manager
368
363
  licenses:
@@ -385,7 +380,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
385
380
  - !ruby/object:Gem::Version
386
381
  version: '0'
387
382
  requirements: []
388
- rubygems_version: 3.1.2
383
+ rubygems_version: 3.1.6
389
384
  signing_key:
390
385
  specification_version: 4
391
386
  summary: Manage your Redis instance (See keys, memory used, connected client, etc...)
@@ -562,11 +557,6 @@ test_files:
562
557
  - spec/dummy/tmp/cache/assets/sprockets/v4.0.0/Rw/Rwoa1O92ek_CiZeWN2fEhw5QTyjdM8gKVJbV-aQS2wc.cache
563
558
  - spec/redis_web_manager_info_spec.rb
564
559
  - spec/redis_web_manager_action_spec.rb
565
- - spec/routing/dashboard_controller_spec.rb
566
- - spec/routing/keys_controller_spec.rb
567
- - spec/routing/actions_controller_spec.rb
568
- - spec/routing/clients_controller_spec.rb
569
- - spec/routing/configuration_controller_spec.rb
570
560
  - spec/redis_web_manager_connection_spec.rb
571
561
  - spec/controllers/redis_web_manager/dashboard_controller_spec.rb
572
562
  - spec/controllers/redis_web_manager/information_controller_spec.rb
@@ -1,31 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require 'rails_helper'
4
-
5
- RSpec.describe RedisWebManager::ActionsController, type: :routing do
6
- routes { RedisWebManager::Engine.routes }
7
-
8
- let(:default) do
9
- RedisWebManager.redises.keys[0]
10
- end
11
-
12
- describe 'routing' do
13
- it 'routes to #reset' do
14
- expect(delete: "/#{default}/reset").to(
15
- route_to('redis_web_manager/actions#reset', instance: default.to_s)
16
- )
17
- end
18
-
19
- it 'routes to #flushdb' do
20
- expect(delete: "/#{default}/flushdb").to(
21
- route_to('redis_web_manager/actions#flushdb', instance: default.to_s)
22
- )
23
- end
24
-
25
- it 'routes to #flushall' do
26
- expect(delete: "/#{default}/flushall").to(
27
- route_to('redis_web_manager/actions#flushall', instance: default.to_s)
28
- )
29
- end
30
- end
31
- end
@@ -1,19 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require 'rails_helper'
4
-
5
- RSpec.describe RedisWebManager::ClientsController, type: :routing do
6
- routes { RedisWebManager::Engine.routes }
7
-
8
- let(:default) do
9
- RedisWebManager.redises.keys[0]
10
- end
11
-
12
- describe 'routing' do
13
- it 'routes to #index' do
14
- expect(get: "/#{default}/clients").to(
15
- route_to('redis_web_manager/clients#index', instance: default.to_s)
16
- )
17
- end
18
- end
19
- end
@@ -1,19 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require 'rails_helper'
4
-
5
- RSpec.describe RedisWebManager::ConfigurationController, type: :routing do
6
- routes { RedisWebManager::Engine.routes }
7
-
8
- let(:default) do
9
- RedisWebManager.redises.keys[0]
10
- end
11
-
12
- describe 'routing' do
13
- it 'routes to #index' do
14
- expect(get: "/#{default}/configuration").to(
15
- route_to('redis_web_manager/configuration#index', instance: default.to_s)
16
- )
17
- end
18
- end
19
- end
@@ -1,19 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require 'rails_helper'
4
-
5
- RSpec.describe RedisWebManager::DashboardController, type: :routing do
6
- routes { RedisWebManager::Engine.routes }
7
-
8
- let(:default) do
9
- RedisWebManager.redises.keys[0]
10
- end
11
-
12
- describe 'routing' do
13
- it 'routes to #index' do
14
- expect(get: "/#{default}/dashboard").to(
15
- route_to('redis_web_manager/dashboard#index', instance: default.to_s)
16
- )
17
- end
18
- end
19
- end
@@ -1,43 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require 'rails_helper'
4
-
5
- RSpec.describe RedisWebManager::KeysController, type: :routing do
6
- routes { RedisWebManager::Engine.routes }
7
-
8
- let(:default) do
9
- RedisWebManager.redises.keys[0]
10
- end
11
-
12
- describe 'routing' do
13
- it 'routes to #index' do
14
- expect(get: "/#{default}/keys").to(
15
- route_to('redis_web_manager/keys#index', instance: default.to_s)
16
- )
17
- end
18
-
19
- it 'routes to #show' do
20
- expect(get: "/#{default}/key").to(
21
- route_to('redis_web_manager/keys#show', instance: default.to_s)
22
- )
23
- end
24
-
25
- it 'routes to #edit' do
26
- expect(get: "/#{default}/key/edit").to(
27
- route_to('redis_web_manager/keys#edit', instance: default.to_s)
28
- )
29
- end
30
-
31
- it 'routes to #update' do
32
- expect(put: "/#{default}/keys").to(
33
- route_to('redis_web_manager/keys#update', instance: default.to_s)
34
- )
35
- end
36
-
37
- it 'routes to #destroy' do
38
- expect(delete: "/#{default}/keys").to(
39
- route_to('redis_web_manager/keys#destroy', instance: default.to_s)
40
- )
41
- end
42
- end
43
- end