Closed postmodern closed 2 years ago
I've also tried stub system, command, args
and stub system, command, args : Bool
, stub :system, commamd, args
, stub :system, command, args : Bool
syntax, but none of those successfully catch calls to #system
.
CommandKit::Man
#man
No manual entry for foo
must call system() with the given man page
when given the section: keyword argument
No manual entry for foo in section 7
must call system() with the given section number and man page
Failures:
1) CommandKit::Man#man must call system() with the given man page
Failure: subject did not receive #system("man", ["foo"]) : Nil at spec/man_spec.cr:23 at least once with any arguments
expected: At least once with any arguments
received: 0 time(s)
# spec/man_spec.cr:23
2) CommandKit::Man#man when given the section: keyword argument must call system() with the given section number and man page
Failure: subject did not receive #system("man", ["7", "foo"]) : Nil at spec/man_spec.cr:32 at least once with any arguments
expected: At least once with any arguments
received: 0 time(s)
# spec/man_spec.cr:32
Finished in 50.21 milliseconds
2 examples, 2 failures
Are you trying to stub the top-level #system
method or is there a #system
method in CommandKit::Man
? If the former, then I think I found an issue in the generated stub. It was calling system
with no arguments when it should have forwarded them - hence the error: wrong number of arguments
. I've pushed something that might fix this to master.
I'm stubbing the top-level #system
. Updated and specs pass now, thanks!
After upgrading to spectator 0.10 I noticed that the
stub method(arg1, ...)
syntax is now being confused as a method call.Trying
stub method(arg1,arg2) { true }
gives me the same error, as well.Spec
Errror
shards.yml