1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26
|
require "test_helper"
class DocsOptionTest < Minitest::Spec
it do
#:method
option = Trailblazer::Option(:object_id)
option.(exec_context: Object.new) # => 1234567
#:method end
#:lambda
option = Trailblazer::Option(-> { object_id })
option.(exec_context: Object.new) # => 1234567
#:lambda end
#:module
class CallMe
def self.call(message:, **options)
message
end
end
option = Trailblazer::Option(CallMe)
option.(keyword_arguments: { message: "hello!" }, exec_context: nil) # => "hello!"
#:module end
end
end
|