Git Product home page Git Product logo

Comments (6)

floehopper avatar floehopper commented on May 13, 2024

I take your point. From memory, I think has_entry started life only accepting separate key and value arguments and then was enhanced to allow a Hash because it resulted in something that was easier to read. My gut reaction is to raise an exception if a Hash with multiple entries is used as an argument, but that seems a little harsh. I'll ponder it some more...

from mocha.

qwertme avatar qwertme commented on May 13, 2024

I would read a has_entry with multiple key, values to mean that the Hash has to contain at least those entries but will not fail if more entries are present.

from mocha.

phillc avatar phillc commented on May 13, 2024

It doesn't even do that currently.

from mocha.

floehopper avatar floehopper commented on May 13, 2024

It doesn't make any sense to me for has_entry to accept multiple entries. It just wouldn't read well. I'm reluctant to remove the possibility to supply a single entry Hash to has_entry, partly because I think it does read better than comma-separated key and value parameters. So I think this just leaves raising an exception as the best option. The exception would explain that you should use has_entries instead. I'll look at implementing this shortly.

from mocha.

floehopper avatar floehopper commented on May 13, 2024

Fixed in c3ffaa9. It would be good if someone could try it out before I release it. It may have to wait for a couple of other changes before release. Thanks for all your interest. Cheers, James.

from mocha.

floehopper avatar floehopper commented on May 13, 2024

@phillc I've now released v0.10.4 which includes this fix. If you're happy with the solution, can you please close this issue. Thanks, James.

from mocha.

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.