Document and test MethodCall

This commit is contained in:
Michael Miller 2022-03-05 16:15:42 -07:00
parent 13f185b801
commit ced98778a4
No known key found for this signature in database
GPG key ID: 32B47AE8F388A1FF
2 changed files with 31 additions and 0 deletions

View file

@ -0,0 +1,26 @@
require "../../spec_helper"
Spectator.describe Spectator::MethodCall do
let(arguments) { Spectator::Arguments.capture(42, "foobar", foo: :bar) }
subject(call) { Spectator::MethodCall.new(:foo, arguments) }
it "stores the method name" do
expect(&.method).to eq(:foo)
end
it "stores arguments" do
expect(&.arguments).to eq(arguments)
end
describe ".capture" do
subject(call) { Spectator::MethodCall.capture(:foo, 42, "foobar", foo: :bar) }
it "stores the method name" do
expect(&.method).to eq(:foo)
end
it "stores arguments" do
expect(&.arguments).to eq(arguments)
end
end
end