searchlight 1.2.1 → 1.2.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- ODNkY2NkZGFiNWQ2NzViZGEyNjE4MWY1OWE2ODcwZTY4YTFkMjVjMA==
4
+ MjE1ZDkyNDA3ZDMyY2JjOGUzMzgzNGZkYTkxNzBmOGUxMzQ1MTE4NA==
5
5
  data.tar.gz: !binary |-
6
- YTZlMGY2Njg4OTJmM2RmYTZkM2FhY2UxYWE3YzVlMDZmNjU2ODg4OQ==
6
+ ZGJmMTc5N2YyNTBjM2RkNTAyOGZiYTExOGIwMTE1ODc0YTYwNTkxYw==
7
7
  !binary "U0hBNTEy":
8
8
  metadata.gz: !binary |-
9
- ZjhlNjgyNDExZjJhZDc1OGIwOTBlYzA2MTE3YmJmOGI3ZWUyNjFhODA2MzRk
10
- NDU1YWMyMDRkNTg1MWU4MGFjMDRjMDE3NzkwZGJiNDcxMmZhODk5MjkzN2Q5
11
- YTU2NmQyZDkyMmQ1ZmVlNzRmYWViYzRkMjYzYmJlZGRjNTdhODY=
9
+ NGRkZDEzZjhkOTJjYTUyZWY3ZDQ4ZGFiNDc2NzE1ZTRhNDNjZjgxNTdiYTdi
10
+ NDM1ZGRjYjJjMmMwNGM4MjcyNjQ3YjQ3N2IwYzdiZTljZTE5NTM5OTcwNTU0
11
+ ZDY2YThkYjAyZjEwYzU4ZjM1NGNkNDc4ZDc0Y2JjNjZkZjJjMjU=
12
12
  data.tar.gz: !binary |-
13
- M2VjMWJlZDRjZDQ2ZTBkZTg1YzBmMWJlNzk4NjA0YzJmZTNhNTVkMzE2OTUz
14
- MWRjNmQ2YjU1NmZjNzE3NTA1ZjQwZTY5ODEwMTFjNjMzNTQ3NDM3MzJiZjBl
15
- MjVmOTMzM2FkY2RkNjE3YzBjODExNjJmMjg0MmM1NDM4ZTVhZjY=
13
+ ODM4NGQ4MjI4M2M3NjU3NTA2N2FlYTcwZWIxYmE3ODZmODkzNDdmY2E5ZGI2
14
+ NTlmMDJkZDgyNzdiNGEyZGFmMWMzOWY4NDg5ZmU5YzBhYWE1NTViYWNmMGIz
15
+ ZWRhNzMxZDQzNWZjODcwZmZiYzc5MTc0ZmZmMTFlNjU1YTQ4N2I=
@@ -2,6 +2,10 @@
2
2
 
3
3
  Searchlight does its best to use [semantic versioning](http://semver.org).
4
4
 
5
+ ## v1.2.2
6
+
7
+ Gracefully handle being given explicit `nil` in initialization instead of options hash or empty arguments
8
+
5
9
  ## v1.2.1
6
10
 
7
11
  Bugfix for v1.2.0 - screen out from options any collections containing only blank values
@@ -45,7 +45,8 @@ module Searchlight
45
45
  @search_target = value
46
46
  end
47
47
 
48
- def filter_and_mass_assign(provided_options)
48
+ def filter_and_mass_assign(provided_options = {})
49
+ provided_options = {} if provided_options.nil?
49
50
  self.options = provided_options.reject { |key, value| is_blank?(value) }
50
51
  begin
51
52
  options.each { |key, value| public_send("#{key}=", value) } if options && options.any?
@@ -1,3 +1,3 @@
1
1
  module Searchlight
2
- VERSION = "1.2.1"
2
+ VERSION = "1.2.2"
3
3
  end
@@ -45,6 +45,26 @@ describe Searchlight::Search do
45
45
 
46
46
  end
47
47
 
48
+ context "when an empty options hash is given" do
49
+
50
+ let(:provided_options) { {} }
51
+
52
+ it "has empty options" do
53
+ expect(search.options).to eq({})
54
+ end
55
+
56
+ end
57
+
58
+ context "when the options are explicitly nil" do
59
+
60
+ let(:provided_options) { nil }
61
+
62
+ it "has empty options" do
63
+ expect(search.options).to eq({})
64
+ end
65
+
66
+ end
67
+
48
68
  end
49
69
 
50
70
  describe "handling invalid options" do
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: searchlight
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.1
4
+ version: 1.2.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nathan Long