neopoly / rohbau

Provides a set of patterns used in Domain Driven Design
MIT License
5 stars 0 forks source link

Record all UseCase calls #25

Open JanOwiesniak opened 7 years ago

JanOwiesniak commented 7 years ago

Example

interface.my_domain(:my_use_case, { :something => '42' })
interface.my_domain(:my_use_case, { :something => '21' })

Current Behavior

My first call is gone.

interface.call_count[:get_ranking] # => 2
interface.calls[:get_ranking] # => {:get_ranking=> {:something=>"21"}}

Expected Behavior

Both calls should be available.

interface.call_count[:get_ranking] # => 2
interface.calls[:get_ranking] # => {:get_ranking=> [{:something=>"42"},{:something=>"21"}]}

/cc @splattael @daxadax @shlub @Khalasar

splattael commented 7 years ago

It's a bug, true :+1:

daxadax commented 7 years ago

I think it's from here:

https://github.com/neopoly/rohbau/blob/master/lib/rohbau/interface.rb#L53

There's only one stub result stored per call name at a time.