ruby-oci8 2.0.2 → 2.0.3

Sign up to get free protection for your applications and to get access to all the features.
@@ -349,13 +349,18 @@ class TestOraNumber < Test::Unit::TestCase
349
349
 
350
350
  # onum <=> other -> -1, 0, +1
351
351
  def test_cmp
352
- test_values = SMALL_RANGE_VALUES.collect do |x|
353
- x[0,15] # donw the precision to pass this test.
354
- end
355
- compare_with_float2(test_values, test_values,
356
- Proc.new {|x, y| x <=> y.to_f})
357
- compare_with_float2(test_values, test_values,
358
- Proc.new {|x, y| y.to_f <=> x})
352
+ assert_equal(-1, 1 <=> OraNumber(2))
353
+ assert_equal(-1, 1.0 <=> OraNumber(2))
354
+ assert_equal(-1, BigDecimal("1") <=> OraNumber(2))
355
+ assert_equal(-1, Rational(1) <=> OraNumber(2))
356
+ assert_equal(0, 2 <=> OraNumber(2))
357
+ assert_equal(0, 2.0 <=> OraNumber(2))
358
+ assert_equal(0, BigDecimal("2") <=> OraNumber(2))
359
+ assert_equal(0, Rational(2) <=> OraNumber(2))
360
+ assert_equal(1, 3 <=> OraNumber(2))
361
+ assert_equal(1, 3.0 <=> OraNumber(2))
362
+ assert_equal(1, BigDecimal("3") <=> OraNumber(2))
363
+ assert_equal(1, Rational(3) <=> OraNumber(2))
359
364
  end
360
365
 
361
366
  # onum.abs -> ocinumber
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ruby-oci8
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.2
4
+ version: 2.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - KUBO Takehiro
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2009-05-17 00:00:00 +09:00
12
+ date: 2009-10-21 00:00:00 +09:00
13
13
  default_executable:
14
14
  dependencies: []
15
15
 
@@ -119,7 +119,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
119
119
  requirements: []
120
120
 
121
121
  rubyforge_project: ruby-oci8
122
- rubygems_version: 1.3.1
122
+ rubygems_version: 1.2.0
123
123
  signing_key:
124
124
  specification_version: 2
125
125
  summary: Ruby interface for Oracle using OCI8 API