Git Product home page Git Product logo

Comments (4)

plu avatar plu commented on September 26, 2024

You're right, this is a better default. I'm gone for the weekend, but if you want to have a look at it in the meantime, I'm going to add you to plu/Pithub. So feel free to just push that change to master :)

from pithub.

schwern avatar schwern commented on September 26, 2024

Thanks. The change is trivial, but it perturbs the tests badly and will require test changes well outside its proportions. Mind you, this was just with setting per_page=30 to see what would happen without a behavioral change.

It potentially changes every URL (I think I can modify it so it only effects queries which use an iterator) which affects many tests. Checks for simple URL equality will have to be changed to take into account the per_page default as well as the unreliable ordering of the query keywords. I've written up url_is to handle this, and it might be worth adding to Test::URI, but I'm not sure where to put it. Pithub::Test would be the normal place, but that's already a testing subclass of Pithub.

The larger problem is with the response mocking. Adding a default query to every URL changes the response filenames which breaks a lot of tests. I could rename all the files to take into account the per_page=30 (and then change them all later 100). I could change Pithub::Test to strip out per_page if it's equal to the default (requiring Test knowledge of Pithub's defaults). Or something else?

Anyhow, that's a lot of test restructuring so I figure I'd get your input before launching off on it. I might not bother since I can just as easily set per_page in my application.

from pithub.

plu avatar plu commented on September 26, 2024

I've fixed one part of the problem (response stub filenames) and you can now use the Pithub::Test module for you intentions, if you want to.

I'm not sure where your code of url_is is living, I guess you have it somewhere? If you want to, you can fix that part, I'd be really happy about it. But I can also understand if you'd prefer that I clean up the mess I created myself :).

from pithub.

schwern avatar schwern commented on September 26, 2024

Done by #167

from pithub.

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.