tabnav 1.0.0 → 1.0.1

Sign up to get free protection for your applications and to get access to all the features.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 1.0.0
1
+ 1.0.1
data/lib/tabnav/tab.rb CHANGED
@@ -41,7 +41,7 @@ module Tabnav
41
41
  # If multiple highlight conditions are given, the tab will be highlighted if any of them match.
42
42
  def highlights_on(rule)
43
43
  if rule.is_a?(Hash)
44
- @active |= rule.with_indifferent_access.all? {|k, v| @params[k] == v.to_s}
44
+ @active |= rule.with_indifferent_access.all? {|k, v| @params[k].to_s == v.to_s}
45
45
  elsif rule.is_a?(Proc)
46
46
  @active |= rule.call
47
47
  end
@@ -121,6 +121,13 @@ describe Tabnav::Tab do
121
121
  t.highlights_on :key1 => "a_value", :key2 => :another_value
122
122
  t.should be_active
123
123
  end
124
+
125
+ it "should allow matching against nil" do
126
+ params = {"key1" => "a_value", "key2" => "another_value", "key3" => "something else"}
127
+ t = Tabnav::Tab.new(@template, params)
128
+ t.highlights_on :key4 => nil
129
+ t.should be_active
130
+ end
124
131
  end
125
132
 
126
133
  describe "proc based rules" do
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: tabnav
3
3
  version: !ruby/object:Gem::Version
4
- hash: 23
4
+ hash: 21
5
5
  prerelease: false
6
6
  segments:
7
7
  - 1
8
8
  - 0
9
- - 0
10
- version: 1.0.0
9
+ - 1
10
+ version: 1.0.1
11
11
  platform: ruby
12
12
  authors:
13
13
  - Unboxed
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2010-07-28 00:00:00 +01:00
18
+ date: 2010-07-29 00:00:00 +01:00
19
19
  default_executable:
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency