simple-navigation 4.2.0 → 4.3.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +6 -1
- data/CHANGELOG.md +6 -0
- data/Rakefile +1 -0
- data/gemfiles/rails-6-1-stable.gemfile +9 -0
- data/lib/simple_navigation/version.rb +1 -1
- data/spec/simple_navigation/adapters/rails_spec.rb +1 -1
- data/spec/simple_navigation/adapters/sinatra_spec.rb +1 -1
- data/spec/simple_navigation/config_file_finder_spec.rb +2 -2
- data/spec/simple_navigation/configuration_spec.rb +2 -2
- data/spec/simple_navigation/helpers_spec.rb +2 -2
- data/spec/simple_navigation/item_container_spec.rb +1 -1
- data/spec/simple_navigation/item_spec.rb +1 -1
- data/spec/simple_navigation/items_provider_spec.rb +1 -1
- data/spec/simple_navigation/renderer/base_spec.rb +1 -1
- data/spec/simple_navigation_spec.rb +2 -2
- data/spec/spec_helper.rb +4 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 32593dd3a7c2dd75f81fe21b56e89ec3fff2570b73461eac762b7911fc096297
|
4
|
+
data.tar.gz: afed0ee3fdf40f71edb92446191699482c52e8cea2bcaf5cf4a9430f55b4e0a2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b70cf93db548b4521e4ee41d8df47c782f7ea1b849935e157dc5d1f686eb32b285daa42bad75a643c208b739097083ce94d90554c7826288cc38724198cba6a0
|
7
|
+
data.tar.gz: 5a376e9eeca42af65b8e23b37b30b3947c3b1d2554e55a3e2527705a80a077fd655d4fddff29b9f744b461f4affdd17ee2640a27fda924e3872882106bcbab8c
|
data/.travis.yml
CHANGED
@@ -3,6 +3,12 @@ before_install:
|
|
3
3
|
|
4
4
|
matrix:
|
5
5
|
include:
|
6
|
+
- rvm: 2.5.8
|
7
|
+
gemfile: gemfiles/rails-6-1-stable.gemfile
|
8
|
+
- rvm: 2.6.7
|
9
|
+
gemfile: gemfiles/rails-6-1-stable.gemfile
|
10
|
+
- rvm: 2.7.3
|
11
|
+
gemfile: gemfiles/rails-6-1-stable.gemfile
|
6
12
|
- rvm: 2.5.3
|
7
13
|
gemfile: gemfiles/rails-6-0-stable.gemfile
|
8
14
|
- rvm: 2.6.0
|
@@ -15,4 +21,3 @@ matrix:
|
|
15
21
|
gemfile: gemfiles/rails-4-1-stable.gemfile
|
16
22
|
- rvm: 2.3.3
|
17
23
|
gemfile: gemfiles/rails-3-2-stable.gemfile
|
18
|
-
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,11 @@
|
|
1
1
|
# Changelog
|
2
2
|
|
3
|
+
## 4.3.0
|
4
|
+
|
5
|
+
* removed warnings from rspec. Thanks mgrunberg.
|
6
|
+
* add compatibility with rails 6.1. Credits to mgrunberg.
|
7
|
+
* run specs against 6.1. Credits to mgrunberg.
|
8
|
+
|
3
9
|
## 4.2.0
|
4
10
|
|
5
11
|
* improvements to generator template. Credits to mgrunberg.
|
data/Rakefile
CHANGED
@@ -186,7 +186,7 @@ module SimpleNavigation
|
|
186
186
|
before { adapter.instance_variable_set(:@template, nil) }
|
187
187
|
|
188
188
|
it 'raises an exception' do
|
189
|
-
expect{ adapter.context_for_eval }.to raise_error
|
189
|
+
expect{ adapter.context_for_eval }.to raise_error(RuntimeError, 'no context set for evaluation the config file')
|
190
190
|
end
|
191
191
|
end
|
192
192
|
end
|
@@ -9,7 +9,7 @@ describe SimpleNavigation::Adapters::Sinatra do
|
|
9
9
|
context "when adapter's context is not set" do
|
10
10
|
it 'raises an exception' do
|
11
11
|
allow(adapter).to receive_messages(context: nil)
|
12
|
-
expect{ adapter.context_for_eval }.to raise_error
|
12
|
+
expect{ adapter.context_for_eval }.to raise_error(RuntimeError, 'no context set for evaluation the config file')
|
13
13
|
end
|
14
14
|
end
|
15
15
|
|
@@ -23,7 +23,7 @@ module SimpleNavigation
|
|
23
23
|
|
24
24
|
context 'and no navigation.rb file is found in the paths' do
|
25
25
|
it 'raises an exception' do
|
26
|
-
expect{ finder.find(context) }.to raise_error
|
26
|
+
expect { finder.find(context) }.to raise_error(RuntimeError, /Config file 'navigation.rb' not found in path\(s\)/)
|
27
27
|
end
|
28
28
|
end
|
29
29
|
end
|
@@ -41,7 +41,7 @@ module SimpleNavigation
|
|
41
41
|
|
42
42
|
context 'and no other_navigation.rb file is found in the paths' do
|
43
43
|
it 'raise an exception' do
|
44
|
-
expect{ finder.find(context) }.to raise_error
|
44
|
+
expect{ finder.find(context) }.to raise_error(RuntimeError, /Config file 'other_navigation.rb' not found in path\(s\)/)
|
45
45
|
end
|
46
46
|
end
|
47
47
|
end
|
@@ -89,7 +89,7 @@ module SimpleNavigation
|
|
89
89
|
let(:provider) { double(:provider) }
|
90
90
|
|
91
91
|
it 'raises an exception' do
|
92
|
-
expect{ config.items(provider) {} }.to raise_error
|
92
|
+
expect{ config.items(provider) {} }.to raise_error(RuntimeError, 'please specify either items_provider or block, but not both')
|
93
93
|
end
|
94
94
|
end
|
95
95
|
|
@@ -139,7 +139,7 @@ module SimpleNavigation
|
|
139
139
|
|
140
140
|
context 'when items_provider is not specified' do
|
141
141
|
it "raises an exception" do
|
142
|
-
expect{ config.items }.to raise_error
|
142
|
+
expect{ config.items }.to raise_error(RuntimeError, 'please specify either items_provider or block, but not both')
|
143
143
|
end
|
144
144
|
end
|
145
145
|
end
|
@@ -382,7 +382,7 @@ module SimpleNavigation
|
|
382
382
|
it 'raises an exception' do
|
383
383
|
expect{
|
384
384
|
controller.render_navigation(level: :invalid)
|
385
|
-
}.to raise_error
|
385
|
+
}.to raise_error(ArgumentError, 'Invalid navigation level: invalid')
|
386
386
|
end
|
387
387
|
end
|
388
388
|
end
|
@@ -408,7 +408,7 @@ module SimpleNavigation
|
|
408
408
|
before { allow(SimpleNavigation).to receive_messages(primary_navigation: nil) }
|
409
409
|
|
410
410
|
it 'raises an exception' do
|
411
|
-
expect{controller.render_navigation}.to raise_error
|
411
|
+
expect{controller.render_navigation}.to raise_error(RuntimeError, 'no primary navigation defined, either use a navigation config file or pass items directly to render_navigation')
|
412
412
|
end
|
413
413
|
end
|
414
414
|
|
@@ -346,7 +346,7 @@ module SimpleNavigation
|
|
346
346
|
let(:options) {{ highlights_on: :hello }}
|
347
347
|
|
348
348
|
it 'raises an exception' do
|
349
|
-
expect{ item.selected? }.to raise_error
|
349
|
+
expect{ item.selected? }.to raise_error(ArgumentError, ':highlights_on must be a Regexp, Proc or :subpath')
|
350
350
|
end
|
351
351
|
end
|
352
352
|
end
|
@@ -36,7 +36,7 @@ module SimpleNavigation
|
|
36
36
|
let(:provider) { double(:provider) }
|
37
37
|
|
38
38
|
it 'raises an exception' do
|
39
|
-
expect{ items_provider.items }.to raise_error
|
39
|
+
expect{ items_provider.items }.to raise_error(RuntimeError, /items_provider either must be a symbol .*, an object .* or an enumerable/)
|
40
40
|
end
|
41
41
|
end
|
42
42
|
end
|
@@ -32,7 +32,7 @@ module SimpleNavigation
|
|
32
32
|
|
33
33
|
describe '#render' do
|
34
34
|
it "raise an exception to indicate it's a subclass responsibility" do
|
35
|
-
expect{ base.render(:container) }.to raise_error
|
35
|
+
expect{ base.render(:container) }.to raise_error(NotImplementedError, 'subclass responsibility')
|
36
36
|
end
|
37
37
|
end
|
38
38
|
|
@@ -104,7 +104,7 @@ describe SimpleNavigation do
|
|
104
104
|
|
105
105
|
context "when the config file for the context doesn't exists" do
|
106
106
|
it 'raises an exception' do
|
107
|
-
expect{ subject.load_config }.to raise_error
|
107
|
+
expect{ subject.load_config }.to raise_error(RuntimeError, /Config file 'navigation.rb' not found in path\(s\)/)
|
108
108
|
end
|
109
109
|
end
|
110
110
|
end
|
@@ -152,7 +152,7 @@ describe SimpleNavigation do
|
|
152
152
|
it 'raises an exception' do
|
153
153
|
expect{
|
154
154
|
subject.active_item_container_for('something else')
|
155
|
-
}.to raise_error
|
155
|
+
}.to raise_error(ArgumentError, 'Invalid navigation level: something else')
|
156
156
|
end
|
157
157
|
end
|
158
158
|
end
|
data/spec/spec_helper.rb
CHANGED
@@ -24,7 +24,10 @@ end
|
|
24
24
|
|
25
25
|
def setup_adapter_for(framework, context = double(:context))
|
26
26
|
if framework == :rails
|
27
|
-
|
27
|
+
# Rails 6.0 and 6.1 provide ActionView::Base.empty method that creates ActionView with an empty LookupContext.
|
28
|
+
# The method is not available on older versions
|
29
|
+
view_context = ActionView::Base.respond_to?(:empty) ? ActionView::Base.empty : ActionView::Base.new
|
30
|
+
allow(context).to receive_messages(view_context: view_context)
|
28
31
|
end
|
29
32
|
|
30
33
|
allow(SimpleNavigation).to receive_messages(framework: framework)
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: simple-navigation
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 4.
|
4
|
+
version: 4.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Andi Schacke
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date: 2021-05-
|
13
|
+
date: 2021-05-13 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: activesupport
|
@@ -177,6 +177,7 @@ files:
|
|
177
177
|
- gemfiles/rails-4-2-stable.gemfile
|
178
178
|
- gemfiles/rails-5-2-stable.gemfile
|
179
179
|
- gemfiles/rails-6-0-stable.gemfile
|
180
|
+
- gemfiles/rails-6-1-stable.gemfile
|
180
181
|
- generators/navigation_config/USAGE
|
181
182
|
- generators/navigation_config/navigation_config_generator.rb
|
182
183
|
- generators/navigation_config/templates/config/navigation.rb
|