Sha256: 94ee6ad2ef38001159673da1ae7d7220fd337ce9b0826aef5ecd264bacfe0dc7
Contents?: true
Size: 727 Bytes
Versions: 3
Compression:
Stored size: 727 Bytes
Contents
require File.join(File.dirname(__FILE__), 'CONFIG.rb') require 'test/unit' require 'og' class TC_Query < Test::Unit::TestCase # :nodoc: all include Og class Item property :quantity, Fixnum property :unit_price, Float def initialize(quantity, unit_price) @quantity = quantity @unit_price = unit_price end def total_price @total_price.to_f end end def setup @og = Og.setup($og_config) end def test_all Item.create(2, 34.5) Item.create(5, 12.6) item = Item.one :select => 'quantity, quantity*unit_price as total_price', :condition => 'oid = 1' assert_equal 2*34.5, item.total_price assert_equal 2, item.quantity.to_i end end
Version data entries
3 entries across 3 versions & 1 rubygems
Version | Path |
---|---|
og-0.24.0 | test/og/tc_select.rb |
og-0.25.0 | test/og/tc_select.rb |
og-0.26.0 | test/og/tc_select.rb |