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