Sha256: 9d73a22b8ed9a98041684843fb65ba7a3968195b67f33be968e1cc674e4f89a2

Contents?: true

Size: 1006 Bytes

Versions: 10

Compression:

Stored size: 1006 Bytes

Contents

# encoding: utf-8

require File.expand_path(File.dirname(__FILE__) + '/../../spec_helper')

describe "OracleEnhancedAdapter to_d method" do
  it "BigDecimal#to_d returns the same decimal number" do
    d = BigDecimal.new("12345678901234567890.0123456789")
    d.to_d.should == d
  end
  
  it "Bignum#to_d translates large integer to decimal" do
    n = 12345678901234567890
    n.to_d.should == BigDecimal.new(n.to_s)
  end

  it "Fixnum#to_d translates small integer to decimal" do
    n = 123456
    n.to_d.should == BigDecimal.new(n.to_s)
  end
end

if ENV['RAILS_GEM_VERSION'] >= '2.3'

  describe "OracleEnhancedAdapter Unicode aware upcase and downcase" do
    before(:all) do
      @down = "āčēģīķļņšūž"
      @up = "ĀČĒĢĪĶĻŅŠŪŽ"
    end

    it "should translate Unicode string to upcase" do
      @down.mb_chars.upcase.to_s.should == @up
    end

    it "should translate Unicode string to downcase" do
      @up.mb_chars.downcase.to_s.should == @down
    end
  
  end

end

Version data entries

10 entries across 10 versions & 4 rubygems

Version Path
unclebilly-activerecord-oracle_enhanced-adapter-1.2.4 spec/active_record/connection_adapters/oracle_enhanced_core_ext_spec.rb
c3-activerecord-oracle_enhanced-adapter-1.2.4 spec/active_record/connection_adapters/oracle_enhanced_core_ext_spec.rb
activerecord-oracle_enhanced-adapter-1.3.1 spec/active_record/connection_adapters/oracle_enhanced_core_ext_spec.rb
activerecord-oracle_enhanced-adapter-1.3.0 spec/active_record/connection_adapters/oracle_enhanced_core_ext_spec.rb
oracle_enhanced-1.3.0.pre2 spec/active_record/connection_adapters/oracle_enhanced_core_ext_spec.rb
oracle_enhanced-1.2.5 spec/active_record/connection_adapters/oracle_enhanced_core_ext_spec.rb
oracle_enhanced-1.3.0.pre spec/active_record/connection_adapters/oracle_enhanced_core_ext_spec.rb
activerecord-oracle_enhanced-adapter-1.2.4 spec/active_record/connection_adapters/oracle_enhanced_core_ext_spec.rb
activerecord-oracle_enhanced-adapter-1.2.3 spec/active_record/connection_adapters/oracle_enhanced_core_ext_spec.rb
activerecord-oracle_enhanced-adapter-1.2.2 spec/active_record/connection_adapters/oracle_enhanced_core_ext_spec.rb