intermine 0.99.01 → 0.99.02

Sign up to get free protection for your applications and to get access to all the features.
@@ -101,7 +101,7 @@ module InterMine::Results
101
101
 
102
102
  cell = @results[idx]
103
103
 
104
- raise IndexError, "Argument out of range" if cell.nil?
104
+ raise IndexError, "Argument out of range" if @columns[idx].nil?
105
105
 
106
106
  return value_of(cell)
107
107
  end
@@ -15,5 +15,6 @@ module Intermine
15
15
  # 0.99.00 - Added coercion from query to lists in "IN/NOT IN" constraints
16
16
  # - Added support for "json" format (performance) improvement
17
17
  # 0.99.01 - Added support for sort-orders on selected classes which are not in the view
18
- VERSION = "0.99.01"
18
+ # 0.99.02 - Fixed bug with null values in new result rows (resulting commonly from outer joins)
19
+ VERSION = "0.99.02"
19
20
  end
@@ -12,9 +12,14 @@ class TestResults < Test::Unit::TestCase
12
12
  super
13
13
  file = File.new(
14
14
  File.dirname(__FILE__) + "/data/resultrow.json", "r")
15
+ file2 = File.new(
16
+ File.dirname(__FILE__) + "/data/resultrow_new.json", "r")
15
17
  @data = file.read
18
+ @data2 = file2.read
16
19
  @json = JSON.parse(@data)
20
+ @json2 = JSON.parse(@data2)
17
21
  @view = ["Company.departments.name","Company.departments.manager.name", "Company.departments.manager.age"]
22
+ @view2 = ["Company.departments.name","Company.departments.manager.name", "Company.departments.manager.age", "Company.address.address"]
18
23
  @bad_view = ["Company.departments.name","Company.departments.manager.name"]
19
24
  end
20
25
 
@@ -42,6 +47,31 @@ class TestResults < Test::Unit::TestCase
42
47
  end
43
48
  end
44
49
 
50
+ def test_array_access2
51
+
52
+ rr = NewResultRow.new(@data2, @view2)
53
+
54
+ assert_equal(rr[0], "DepartmentA1")
55
+ assert_equal(rr[1], "EmployeeA1")
56
+
57
+ rr = NewResultRow.new(@json2, @view2)
58
+
59
+ assert_equal(rr[0], "DepartmentA1")
60
+ assert_equal(rr[1], "EmployeeA1")
61
+
62
+ assert_equal(rr[1..2], ["EmployeeA1", 33])
63
+ assert_equal(rr[0, 2], ["DepartmentA1", "EmployeeA1"])
64
+
65
+ assert_equal(rr.first, "DepartmentA1")
66
+ assert_equal(rr[3], nil)
67
+ assert_equal(rr.last, nil)
68
+
69
+ assert_raise IndexError do
70
+ rr[4]
71
+ end
72
+
73
+ end
74
+
45
75
  def test_array_access
46
76
 
47
77
  rr = ResultsRow.new(@data, @view)
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: intermine
3
3
  version: !ruby/object:Gem::Version
4
- hash: 401
4
+ hash: 407
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 99
9
- - 1
10
- version: 0.99.01
9
+ - 2
10
+ version: 0.99.02
11
11
  platform: ruby
12
12
  authors:
13
13
  - Alex Kalderimis
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2011-12-12 00:00:00 Z
18
+ date: 2011-12-27 00:00:00 Z
19
19
  dependencies:
20
20
  - !ruby/object:Gem::Dependency
21
21
  name: json