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