Sha256: 1ee5df3192fa727d18942b079f352f9beaa8921ebfc7bd68c787c69d4f84fdf0

Contents?: true

Size: 1.26 KB

Versions: 64

Compression:

Stored size: 1.26 KB

Contents

# encoding: utf-8

require File.expand_path(File.join(File.dirname(__FILE__), '..', 'spec_helper'))
require 'data_objects/spec/shared/typecast/float_spec'

describe 'DataObjects::Oracle with Float' do
  it_should_behave_like 'supporting Float'
  # it_should_behave_like 'supporting Float autocasting'
end

describe 'DataObjects::Oracle with Float supporting Float autocasting' do

  include DataObjectsSpecHelpers

  before :all do
    setup_test_environment
  end

  before do
    @connection = DataObjects::Connection.new(CONFIG.uri)
  end

  after do
    @connection.close
  end

  describe 'reading a Float' do

    describe 'with automatic typecasting' do

      before  do
        @reader = @connection.create_command("SELECT weight, cost1 FROM widgets WHERE ad_description = ?").execute_reader('Buy this product now!')
        @reader.next!
        @values = @reader.values
      end

      after do
        @reader.close
      end

      it 'should return the correctly typed result' do
        @values.first.should be_kind_of(Float)
        @values.last.should be_kind_of(Float)
      end

      it 'should return the correct result' do
        @values.first.should be_within(0.000001).of(13.4)
        @values.last.should  be_within(0.000001).of(10.23)
      end

    end

  end

end

Version data entries

64 entries across 64 versions & 1 rubygems

Version Path
do_oracle-0.10.17 spec/typecast/float_spec.rb
do_oracle-0.10.17-x86-mswin32-60 spec/typecast/float_spec.rb
do_oracle-0.10.17-x86-mingw32 spec/typecast/float_spec.rb
do_oracle-0.10.17-java spec/typecast/float_spec.rb
do_oracle-0.10.16 spec/typecast/float_spec.rb
do_oracle-0.10.16-x86-mswin32-60 spec/typecast/float_spec.rb
do_oracle-0.10.16-x86-mingw32 spec/typecast/float_spec.rb
do_oracle-0.10.16-java spec/typecast/float_spec.rb
do_oracle-0.10.15 spec/typecast/float_spec.rb
do_oracle-0.10.15-x86-mswin32-60 spec/typecast/float_spec.rb
do_oracle-0.10.15-x86-mingw32 spec/typecast/float_spec.rb
do_oracle-0.10.15-java spec/typecast/float_spec.rb
do_oracle-0.10.14 spec/typecast/float_spec.rb
do_oracle-0.10.14-x86-mswin32-60 spec/typecast/float_spec.rb
do_oracle-0.10.14-x86-mingw32 spec/typecast/float_spec.rb
do_oracle-0.10.14-java spec/typecast/float_spec.rb
do_oracle-0.10.13 spec/typecast/float_spec.rb
do_oracle-0.10.13-x86-mswin32-60 spec/typecast/float_spec.rb
do_oracle-0.10.13-x86-mingw32 spec/typecast/float_spec.rb
do_oracle-0.10.13-java spec/typecast/float_spec.rb