rex/spec/book/order_spec.rb

26 lines
532 B
Ruby
Raw Normal View History

2023-10-27 19:09:24 +02:00
# frozen_string_literal: true
2023-11-08 20:33:49 +01:00
RSpec.describe Rex::Book::Order do
2023-10-27 19:09:24 +02:00
describe "#filled?" do
let(:order) do
2023-10-28 14:06:03 +02:00
instance = build(:order)
instance.remaining_quantity = remaining_quantity
2023-10-27 19:09:24 +02:00
instance
end
subject { order.filled? }
context "when remaining quantity is not zero" do
let(:remaining_quantity) { 50 }
2023-10-27 19:09:24 +02:00
it { is_expected.to be(false) }
end
context "when remaining quantity is zero" do
let(:remaining_quantity) { 0 }
2023-10-27 19:09:24 +02:00
it { is_expected.to be(true) }
end
end
end