GithubHelp home page GithubHelp logo

Comments (3)

postmodern avatar postmodern commented on June 15, 2024

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

from spectator.

icy-arctic-fox avatar icy-arctic-fox commented on June 15, 2024

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.

from spectator.

postmodern avatar postmodern commented on June 15, 2024

I'm stubbing the top-level #system. Updated and specs pass now, thanks!

from spectator.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.