rlocu 0.1.0 → 0.2.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,7 +0,0 @@
1
- require 'test/unit'
2
-
3
- class TruthTest < Test::Unit::TestCase
4
- def test_reality
5
- assert true, "aye, it is true"
6
- end
7
- end
@@ -1,21 +0,0 @@
1
- require 'test/unit'
2
- require_relative '../lib/rlocu'
3
-
4
- class UtilitiesTest < Test::Unit::TestCase
5
- include Rlocu
6
- def test_location_raises
7
- assert_raise ArgumentError do Location.new('some','silliness') end
8
- end
9
-
10
- def test_location_to_s
11
- l = Location.new(123.4,678)
12
- assert_equal '123.4,678', l.to_s
13
- end
14
-
15
- def test_encode
16
- #params = {name: 'bamboo thai', postal_code: '90278'}
17
- skip "insert your api into .config"
18
- #assert_equal 'api_key=YOUR_API_HERE&name=bamboo%20thai&postal_code=90278', Rlocu.encode(params)
19
- end
20
-
21
- end
@@ -1,15 +0,0 @@
1
- require 'test/unit'
2
- require_relative '../lib/rlocu'
3
- require 'JSON'
4
-
5
- class VenueTest < Test::Unit::TestCase
6
- include Rlocu
7
- def test_menu_setter
8
- params = {name: 'bamboo thai', postal_code: '90278'}
9
- venues = Rlocu::VenueSearch.query(params)
10
-
11
- deets = Rlocu::VenueDetails.query(venues)
12
-
13
-
14
- end
15
- end
@@ -1,11 +0,0 @@
1
- require 'test/unit'
2
- require_relative '../lib/rlocu'
3
-
4
- class VenueDetailsTest < Test::Unit::TestCase
5
- include Rlocu
6
- def test_reduce_ids
7
- venues = Set.new
8
- 5.times {|n| venues << Venue.new(id: n)}
9
- assert_equal '0;1;2;3;4', Rlocu::VenueDetails.send(:reduce_ids, venues)
10
- end
11
- end
@@ -1,26 +0,0 @@
1
- require 'test/unit'
2
- require_relative '../lib/rlocu'
3
-
4
- class VenueSearchTest < Test::Unit::TestCase
5
- include Rlocu
6
- def test_bad_arg_throws_error
7
- assert_raise ArgumentError do VenueSearch.query(bad_param: 'blah') end
8
- end
9
-
10
- def test_venue_search
11
- params = {name: 'bamboo thai', postal_code: '90278'}
12
- venues = VenueSearch.query(params)
13
- assert_equal 'Bamboo Thai Bistro', venues[0].name
14
- end
15
-
16
- def test_venue_search_block
17
- params = {postal_code: '90278'}
18
- # the search will only return 25 so we can be pretty confident this wont change
19
- str = ''
20
- VenueSearch.query(params) do |p|
21
- str << p.region
22
- end
23
- assert_equal 'CA'*25, str
24
- end
25
- end
26
-