sparkql 1.2.5 → 1.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -8,8 +8,8 @@ class Sparkql::Geo::RecordRadiusTest < Test::Unit::TestCase
8
8
  "201000000000000000000000000",
9
9
  "test",
10
10
  "12.45,-96.5"].each do |bad_record_id|
11
- assert !Sparkql::Geo::RecordRadius.valid_record_id?(bad_record_id),
12
- "'#{bad_record_id}' should not be a valid record_id"
11
+ assert !Sparkql::Geo::RecordRadius.valid_record_id?(bad_record_id),
12
+ "'#{bad_record_id}' should not be a valid record_id"
13
13
  end
14
14
  end
15
15
  end
@@ -4,20 +4,20 @@ class LexerTest < Test::Unit::TestCase
4
4
  include Sparkql
5
5
 
6
6
  test "record the current token and current oken position" do
7
- @lexer = Lexer.new "City Eq 'Fargo'"
8
- token = @lexer.shift
9
- assert_equal "City", @lexer.current_token_value
10
- assert_equal 0, @lexer.token_index
7
+ @lexer = Lexer.new "City Eq 'Fargo'"
8
+ @lexer.shift
9
+ assert_equal "City", @lexer.current_token_value
10
+ assert_equal 0, @lexer.token_index
11
11
 
12
- token = @lexer.shift
13
- assert_equal " ", @lexer.current_token_value
14
- assert_equal 4, @lexer.token_index
12
+ @lexer.shift
13
+ assert_equal " ", @lexer.current_token_value
14
+ assert_equal 4, @lexer.token_index
15
15
 
16
- token = @lexer.shift
17
- assert_equal "Eq", @lexer.current_token_value
18
- assert_equal 5, @lexer.token_index
16
+ @lexer.shift
17
+ assert_equal "Eq", @lexer.current_token_value
18
+ assert_equal 5, @lexer.token_index
19
19
  end
20
-
20
+
21
21
  def test_check_reserved_words_standard_fields
22
22
  ["OrOrOr Eq true", "Equador Eq true", "Oregon Ge 10"].each do |standard_field|
23
23
  @lexer = Lexer.new(standard_field)
@@ -27,7 +27,7 @@ class LexerTest < Test::Unit::TestCase
27
27
  end
28
28
 
29
29
  def test_standard_field_formats
30
- ["City", "PostalCodePlus4", "Inb4ParserError"].each do |standard_field|
30
+ %w[City PostalCodePlus4 Inb4ParserError].each do |standard_field|
31
31
  @lexer = Lexer.new("#{standard_field} Eq true")
32
32
  token = @lexer.shift
33
33
  assert_equal :STANDARD_FIELD, token.first, standard_field
@@ -39,7 +39,7 @@ class LexerTest < Test::Unit::TestCase
39
39
  @lexer = Lexer.new("4PostalCodePlus4 Eq true")
40
40
  token = @lexer.shift
41
41
  assert_equal :INTEGER, token.first
42
- assert_equal token[1][:value], "4"
42
+ assert_equal token[1][:value], "4"
43
43
  end
44
44
 
45
45
  def test_check_reserved_words_conjunctions
@@ -62,7 +62,7 @@ class LexerTest < Test::Unit::TestCase
62
62
  assert_equal :OPERATOR, token.first, op
63
63
  end
64
64
 
65
- ['Bt 1234','Bt 1234,12345'].each do |op|
65
+ ['Bt 1234', 'Bt 1234,12345'].each do |op|
66
66
  @lexer = Lexer.new(op)
67
67
  token = @lexer.shift
68
68
  assert_equal :RANGE_OPERATOR, token.first, op
@@ -78,7 +78,7 @@ class LexerTest < Test::Unit::TestCase
78
78
  end
79
79
 
80
80
  def test_dates_matches
81
- ['2013-07-26', '1999-01-01'].each do |op|
81
+ %w[2013-07-26 1999-01-01].each do |op|
82
82
  @lexer = Lexer.new(op)
83
83
  token = @lexer.shift
84
84
  assert_equal :DATE, token.first, op
@@ -108,5 +108,4 @@ class LexerTest < Test::Unit::TestCase
108
108
  assert_equal :DECIMAL, token.first, op
109
109
  end
110
110
  end
111
-
112
111
  end