Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Stub method shared tests #458

Open
wants to merge 33 commits into
base: main
Choose a base branch
from

Commits on Feb 16, 2020

  1. Configuration menu
    Copy the full SHA
    c203058 View commit details
    Browse the repository at this point in the history
  2. replace module_eval with send

    nitishr committed Feb 16, 2020
    Configuration menu
    Copy the full SHA
    36888e8 View commit details
    Browse the repository at this point in the history
  3. prep to DRY by using send instead of direct invocation

    ... making it identical to protected and private method cases
    nitishr committed Feb 16, 2020
    Configuration menu
    Copy the full SHA
    c455732 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    d2362c5 View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    26de50e View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    6fe3702 View commit details
    Browse the repository at this point in the history
  7. Configuration menu
    Copy the full SHA
    fec664a View commit details
    Browse the repository at this point in the history
  8. Configuration menu
    Copy the full SHA
    9c47db1 View commit details
    Browse the repository at this point in the history
  9. inline delegating methods

    nitishr committed Feb 16, 2020
    Configuration menu
    Copy the full SHA
    90570ec View commit details
    Browse the repository at this point in the history
  10. Configuration menu
    Copy the full SHA
    32562f1 View commit details
    Browse the repository at this point in the history
  11. Configuration menu
    Copy the full SHA
    2e425af View commit details
    Browse the repository at this point in the history
  12. allow instantiation to be parameterized by subclassing

    This will allow us to reuse StubInstanceMethodSharedTests in
    StubInstanceMethodDefinedOnClassTest (and perhaps others)
    nitishr committed Feb 16, 2020
    Configuration menu
    Copy the full SHA
    0d024d4 View commit details
    Browse the repository at this point in the history
  13. Configuration menu
    Copy the full SHA
    44037fe View commit details
    Browse the repository at this point in the history
  14. Configuration menu
    Copy the full SHA
    388c608 View commit details
    Browse the repository at this point in the history
  15. Configuration menu
    Copy the full SHA
    b8505d1 View commit details
    Browse the repository at this point in the history
  16. Configuration menu
    Copy the full SHA
    60036df View commit details
    Browse the repository at this point in the history
  17. split StubInstanceMethodDefinedOnKernelModuleTest into two

    This allows us to reuse StubInstanceMethodSharedTests for checking stubbing on a
    Module and stubbing on an object
    nitishr committed Feb 16, 2020
    Configuration menu
    Copy the full SHA
    e9cfc66 View commit details
    Browse the repository at this point in the history
  18. return stubbed instance instead of stubbed class

    This will allow us to reuse StubInstanceMethodSharedTests in
    StubInstanceMethodDefinedOnSingletonClass as instead of creating an instance
    from a class there, we obtain the (singleton) class from the instance.
    nitishr committed Feb 16, 2020
    Configuration menu
    Copy the full SHA
    eef3880 View commit details
    Browse the repository at this point in the history
  19. Configuration menu
    Copy the full SHA
    a84b186 View commit details
    Browse the repository at this point in the history
  20. Configuration menu
    Copy the full SHA
    adc1d2f View commit details
    Browse the repository at this point in the history
  21. Configuration menu
    Copy the full SHA
    bffb23d View commit details
    Browse the repository at this point in the history
  22. Configuration menu
    Copy the full SHA
    1180f77 View commit details
    Browse the repository at this point in the history
  23. reuse StubInstanceMethodSharedTests in StubClassMethod*Test

    ...since class methods are just instance methods of the singleton class of class
    nitishr committed Feb 16, 2020
    Configuration menu
    Copy the full SHA
    ba0617b View commit details
    Browse the repository at this point in the history
  24. allow stub_owner to be different from stubbed_instance

    This will allow us to, for instance, stub a method on a superclass but check the
    stubbed method on its child
    nitishr committed Feb 16, 2020
    Configuration menu
    Copy the full SHA
    6d3b047 View commit details
    Browse the repository at this point in the history
  25. Configuration menu
    Copy the full SHA
    0ea322e View commit details
    Browse the repository at this point in the history
  26. remove 'instance' qualifier from shared tests

    ... since it is now used for instance as well as class methods
    nitishr committed Feb 16, 2020
    Configuration menu
    Copy the full SHA
    6a0bbc3 View commit details
    Browse the repository at this point in the history
  27. reuse StubMethodSharedTests in StubModuleMethodTest

    ... and delete test_should_stub_method_within_test as covered by checks
    in StubMethodSharedTests
    nitishr committed Feb 16, 2020
    Configuration menu
    Copy the full SHA
    060ebb7 View commit details
    Browse the repository at this point in the history
  28. reuse StubMethodSharedTests in StubAnyInstanceMethodTest

    delete test_should_stub_*_method_within_test as already covered by checks in
    StubMethodSharedTests
    nitishr committed Feb 16, 2020
    Configuration menu
    Copy the full SHA
    1b5af22 View commit details
    Browse the repository at this point in the history
  29. Configuration menu
    Copy the full SHA
    fdc2e2b View commit details
    Browse the repository at this point in the history
  30. use shared tests for AnyInstance superclass checks

    ... while moving them from stub_any_instance_method_test to
    stub_any_instance_method_defined_on_superclass_test
    nitishr committed Feb 16, 2020
    Configuration menu
    Copy the full SHA
    620ff24 View commit details
    Browse the repository at this point in the history
  31. delete test_should_be_able_to_stub_a_superclass_method

    It wasn't checking stubbing of a supeclass or even a supermodule method.
    self.my_superclass_method from supermod isn't inherited/included in mod.
    So, all that it checked was that you could stub a non-existent module method.
    nitishr committed Feb 16, 2020
    Configuration menu
    Copy the full SHA
    99ca183 View commit details
    Browse the repository at this point in the history
  32. extract assert_passed_with_snapshot_unchanged

    ... to DRY up assert_snapshot_unchanged + run_as_test + assert_passed combo
    nitishr committed Feb 16, 2020
    Configuration menu
    Copy the full SHA
    aad1b3f View commit details
    Browse the repository at this point in the history
  33. Configuration menu
    Copy the full SHA
    18c8c49 View commit details
    Browse the repository at this point in the history