Closed darkside closed 9 years ago
@edraut @gomayonqui can you guys take a look at this failure? I've been debugging for hours, can't for the life of me figure out where the [] is coming from, it seems it doesn't even pass by the MySingleton#perform
1) Error:
async methods#test_0003_responds to async methods on singletons:
MockExpectationError: expected perform("interesting stuff") => nil, got []
minitest (5.5.1) lib/minitest/mock.rb:100:in block (2 levels) in verify' minitest (5.5.1) lib/minitest/mock.rb:96:in
each'
minitest (5.5.1) lib/minitest/mock.rb:96:in block in verify' minitest (5.5.1) lib/minitest/mock.rb:95:in
each'
minitest (5.5.1) lib/minitest/mock.rb:95:in verify' /home/darkside/work/staunchrobots/coney_island/test/performer_test.rb:90:in
block (2 levels) in class:PerformerTest'
minitest (5.5.1) lib/minitest/test.rb:108:in block (3 levels) in run' minitest (5.5.1) lib/minitest/test.rb:206:in
capture_exceptions'
minitest (5.5.1) lib/minitest/test.rb:105:in block (2 levels) in run' minitest (5.5.1) lib/minitest/test.rb:258:in
time_it'
minitest (5.5.1) lib/minitest/test.rb:104:in block in run' minitest (5.5.1) lib/minitest.rb:327:in
on_signal'
minitest (5.5.1) lib/minitest/test.rb:278:in with_info_handler' minitest (5.5.1) lib/minitest/test.rb:103:in
run'
minitest (5.5.1) lib/minitest.rb:774:in run_one_method' minitest (5.5.1) lib/minitest.rb:301:in
run_one_method'
minitest (5.5.1) lib/minitest.rb:289:in block (2 levels) in run' minitest (5.5.1) lib/minitest.rb:288:in
each'
minitest (5.5.1) lib/minitest.rb:288:in block in run' minitest (5.5.1) lib/minitest.rb:327:in
on_signal'
minitest (5.5.1) lib/minitest.rb:314:in with_info_handler' minitest (5.5.1) lib/minitest.rb:287:in
run'
minitest (5.5.1) lib/minitest.rb:150:in block in __run' minitest (5.5.1) lib/minitest.rb:150:in
map'
minitest (5.5.1) lib/minitest.rb:150:in __run' minitest (5.5.1) lib/minitest.rb:127:in
run'
minitest (5.5.1) lib/minitest.rb:56:in `block in autorun'
@darkside, I believe the error message for expectations is cryptic. I can't recall exactly, but when it says it got [] it probably doesn't mean what you think. The empty array represents the params that should have been passed into the method, I think. ie. the call was made but with no params or the wrong params?
this is super weird. Tomorrow I'm going to do a live test of the same scenario and see if I can get it to break or work.
@edraut but this is the return value, isn't it? The perform is just an empty method, it should be returning nil. I even pried #perform and it never gets called, I am at a loss.
We can try to debug this together tomorrow.
:+1:
Right now defining set_background_defaults on a base class doesn't stick for their subclasses. We need to make the coney_settings hash a proper class attribute. This PR aims to fix that by allowing defaults to be passed on a base class and optionally refining these on subclasses, so something like this would work: