powells 0.0.1 → 0.0.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: c9bc301f76a4e6930e5aeb6590a038b0add6f881
4
- data.tar.gz: 771df08d8a3f6cb816a56ad0cf23e3def01aa591
3
+ metadata.gz: acb2d9de3f62af9729675823fa08ab636cc83081
4
+ data.tar.gz: 81e9301be2dd6b986caa601885e72e9fedcb2176
5
5
  SHA512:
6
- metadata.gz: dad222fd1f928c9e5abc68117fbaa7cdd1abae9ac08b394a26f08f9ca1abd04ed7e33197663f27d18a07c85331f90dd48cffe96cdf900c3ab0f97fc36adec95d
7
- data.tar.gz: 28f3e58e4fb11c8a7185d56cc0924a6c7d89ffddd2cd841e74d0d924b763f54edd5074b03f727bf357e5c90ef51a5daccf6f4f0472191ba0c28f4b5f988f09fa
6
+ metadata.gz: 6434d6b61ca0161ccbe5289c516e3a718850196b314dca6df70b6d4450b1f205d959ae0263e3728afdad21eb11d5f910408013ec614fb2d9b111615e96df4dc9
7
+ data.tar.gz: c06bf8df6c925444db7582d58247d1bb406e9e062efde11d402b406619c0cec235315895708398f30bc81b6017987d6a524475b89d56d29c466b7af21096282e
@@ -80,7 +80,11 @@ module Powells
80
80
  end
81
81
 
82
82
  def build_path(ary)
83
- [@api_version, @api_key].concat(ary).compact.join('/')
83
+ [@api_version, api_key].concat(ary).compact.join('/')
84
+ end
85
+
86
+ def api_key
87
+ @api_key or raise ArgumentError.new('Missing API key')
84
88
  end
85
89
  end
86
90
  end
@@ -1,3 +1,3 @@
1
1
  module Powells
2
- VERSION = '0.0.1'
2
+ VERSION = '0.0.2'
3
3
  end
data/test/test_powells.rb CHANGED
@@ -80,4 +80,10 @@ class TestPowells < Minitest::Unit::TestCase
80
80
  res = @powells.debug.search('harry potter')
81
81
  assert_includes res.to_h.keys, 'input'
82
82
  end
83
+
84
+ def test_api_key_guard
85
+ assert_raises(ArgumentError) do
86
+ Powells.new.search('foo')
87
+ end
88
+ end
83
89
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: powells
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Hakan Ensari