Sha256: 52ec1c620a98c2e9a7aa40d88fc316ecf3b6968c860bb3163a9014a949d54585

Contents?: true

Size: 991 Bytes

Versions: 13

Compression:

Stored size: 991 Bytes

Contents

# encoding: utf-8

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

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

13 entries across 13 versions & 6 rubygems

Version Path
plukevdh-activerecord-oracle_enhanced-adapter-1.2.1 spec/active_record/connection_adapters/oracle_enhanced_core_ext_spec.rb
rsim-activerecord-oracle_enhanced-adapter-1.1.9.93 spec/active_record/connection_adapters/oracle_enhanced_core_ext_spec.rb
rsim-activerecord-oracle_enhanced-adapter-1.2.0.1 spec/active_record/connection_adapters/oracle_enhanced_core_ext_spec.rb
rsim-activerecord-oracle_enhanced-adapter-1.2.0.2 spec/active_record/connection_adapters/oracle_enhanced_core_ext_spec.rb
rsim-activerecord-oracle_enhanced-adapter-1.2.0 spec/active_record/connection_adapters/oracle_enhanced_core_ext_spec.rb
rsim-activerecord-oracle_enhanced-adapter-1.2.1 spec/active_record/connection_adapters/oracle_enhanced_core_ext_spec.rb
rwc9u-activerecord-oracle_enhanced-adapter-1.2.0 spec/active_record/connection_adapters/oracle_enhanced_core_ext_spec.rb
saberma-activerecord-oracle_enhanced-adapter-nvarchar2-1.2.1.1 spec/active_record/connection_adapters/oracle_enhanced_core_ext_spec.rb
saberma-activerecord-oracle_enhanced-adapter-nvarchar2-1.2.1.2 spec/active_record/connection_adapters/oracle_enhanced_core_ext_spec.rb
saberma-activerecord-oracle_enhanced-adapter-nvarchar2-1.2.1 spec/active_record/connection_adapters/oracle_enhanced_core_ext_spec.rb
saberma-saberma-activerecord-oracle_enhanced-adapter-nvarchar2-1.2.1 spec/active_record/connection_adapters/oracle_enhanced_core_ext_spec.rb
activerecord-oracle_enhanced-adapter-1.2.1 spec/active_record/connection_adapters/oracle_enhanced_core_ext_spec.rb
activerecord-oracle_enhanced-adapter-1.2.0 spec/active_record/connection_adapters/oracle_enhanced_core_ext_spec.rb