Sha256: 054e7c4bbfc6ea9bfc3d5fbb5d8377be4d734d0e31d7c1ea1b8201019ddb1f65

Contents?: true

Size: 860 Bytes

Versions: 4

Compression:

Stored size: 860 Bytes

Contents

require 'model_helper'

describe IB::Models::Bar do # AKA IB::Bar

  let(:props) do
    {:open => 1.31,
     :high => 1.35,
     :low => 1.30,
     :close => 1.33,
     :wap => 1.32,
     :volume => 20000,
     :has_gaps => true,
     :trades => 50,
     :time => "20120312  15:41:09",
    }
  end

  let(:errors) do
    {:close => ["is not a number"],
     :high => ["is not a number"],
     :low => ["is not a number"],
     :open => ["is not a number"],
     :volume => ["is not a number"]}
  end

  let(:assigns) do
    {:has_gaps => {[1, true] => true, [0, false] => false},

     [:open, :high, :low, :close, :volume] =>
         {[:foo, 'BAR', nil] => /is not a number/}
    }
  end

  let(:human) do
    "<Bar: 20120312  15:41:09 wap 1.32 OHLC 1.31 1.35 1.3 1.33 trades 50 vol 20000 gaps true>"
  end

  it_behaves_like 'Model'

end # describe IB::Bar

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
ib-ruby-0.7.11 spec/ib-ruby/models/bar_spec.rb
ib-ruby-0.7.10 spec/ib-ruby/models/bar_spec.rb
ib-ruby-0.7.9 spec/ib-ruby/models/bar_spec.rb
ib-ruby-0.7.8 spec/ib-ruby/models/bar_spec.rb