28 lines
549 B
Ruby
28 lines
549 B
Ruby
|
# frozen_string_literal: true
|
||
|
|
||
|
RSpec.describe Rex::Order do
|
||
|
describe "#filled?" do
|
||
|
let(:order) do
|
||
|
instance = described_class.new(
|
||
|
amount: 100
|
||
|
)
|
||
|
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
|