Return the cancelled order explicitly
This commit is contained in:
parent
cd2262e895
commit
dd441df8ff
@ -43,6 +43,7 @@ module Rex
|
|||||||
end
|
end
|
||||||
|
|
||||||
order_ids.delete(order.id)
|
order_ids.delete(order.id)
|
||||||
|
order
|
||||||
end
|
end
|
||||||
|
|
||||||
alias_method :cancel_order, :remove_order
|
alias_method :cancel_order, :remove_order
|
||||||
|
@ -109,6 +109,12 @@ RSpec.describe Rex::Book::LimitOrderBook do
|
|||||||
instance.add_order(buy_order)
|
instance.add_order(buy_order)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
it "returns the cancelled order" do
|
||||||
|
order = instance.cancel_order(buy_order.id)
|
||||||
|
|
||||||
|
expect(order).to eq(buy_order)
|
||||||
|
end
|
||||||
|
|
||||||
context "when the order id is unknown" do
|
context "when the order id is unknown" do
|
||||||
it "returns nil" do
|
it "returns nil" do
|
||||||
expect(instance.cancel_order(-1)).to eq(nil)
|
expect(instance.cancel_order(-1)).to eq(nil)
|
||||||
|
Loading…
Reference in New Issue
Block a user