test/operation_skill_test.rb in trailblazer-operation-0.0.4 vs test/operation_skill_test.rb in trailblazer-operation-0.0.5
- old
+ new
@@ -10,16 +10,15 @@
it { Create.({}, contract: Object)[:not_existent].must_equal nil }
it { Create.({}, contract: Object)[:contract].must_equal Object }
end
class OperationCompetenceTest < Minitest::Spec
- Call = ->(input, options) { input.call }
# Operation#[]
# Operation#[]=
# arbitrary options can be saved via Op#[].
class Create < Trailblazer::Operation
- self.> Call
+ self.> :call
def call(*)
self["drink"] = "Little Creatures"
self["drink"]
end
@@ -36,11 +35,11 @@
# Operation::[]
# Operation::[]=
class Update < Trailblazer::Operation
- self.> Call
+ self.> :call
self["drink"] = "Beer"
def call(*)
self["drink"]
@@ -55,10 +54,10 @@
# runtime constructor options can override class-level.
it { Update.({}, "drink" => "Little Creatures")["drink"].must_equal "Little Creatures" }
# instance can override class-level
class Delete < Trailblazer::Operation
- self.> Call
+ self.> :call
self["drink"] = "Beer"
def call(*)
self["drink"] = "Little Creatures"