Skip to content
Commits on May 2, 2012
  1. Make it possible to serialize and deserialize a stub object.

    Previously this was raising an exception because Mock#respond_to? was
    being called before the instance of Mock has been re-hydrated i.e. none
    of its instance variables had been set :-
    
        NoMethodError: undefined method `matches_method?' for nil:NilClass
    from gems/mocha-0.10.5/lib/mocha/mock.rb:185:in `respond_to?'
    
    Note that I would not recommend using stubs in this way, but I decided
    it was a shame that an exception was raised unnecessarily.
    
    Note also that any expectations set on the original instance of Mock
    will not be satisfied by invoking method on the re-hydrated instance of
    Mock, because the two instances are completely different. This might be
    solved by de-registering the Mock object when an instance with the same
    "identitifer" is registered, but then I start wondering whether the
    whole thing is a silly idea and we'd be better off raising an exception
    if anyone attempts to serialize an instance of Mock.
    committed May 2, 2012
Commits on Apr 25, 2012
  1. Fix #78.

    It appears that Object#__method__ is already a Ruby method. Who knew!
    committed Apr 25, 2012
Commits on Apr 24, 2012
  1. Tweaks to 035a774.

    - Bring `Object#_method` into line with other "hidden" methods and use
    surrounding double underscores i.e. `Object#__method__`.
    - Make test name a little clearer.
    committed Apr 24, 2012
  2. Merge pull request #77 from sikachu/object_method

    Alias `Object#method` to `Object#_method`
    committed Apr 24, 2012
Commits on Apr 23, 2012
  1. @sikachu

    Alias `Object#method` to `Object#_method`

    This will fix the problem when using Mocha to stub an object that reimplement `#method` method.
    sikachu committed Apr 23, 2012
Commits on Apr 22, 2012
  1. Disable jekyll processing for github pages.

    Files with leading underscores were not being served.
    committed Apr 22, 2012
  2. Remove SHAs and revision numbers from release notes.

    Since all but the very earliest releases are tagged in the git
    repository, these serve no useful purpose, make the release notes look
    ugly in YARD, and add to the work needed for a release.
    committed Apr 22, 2012
Commits on Apr 21, 2012
  1. Add v0.11.0 to list of bad versions.

    Note that I have now "gem yanked" all 3 of these bad versions.
    committed Apr 21, 2012
  2. Methods with block parameter were not restored properly in Ruby 1.8.7.

    - Converting the original method to a `Proc` meant we lost the block
      parameter in the restored version of the method.
    - Hopefully this fixes #76.
    committed Apr 21, 2012
Commits on Apr 19, 2012
  1. Remove TODO list from repository.

    We only need this locally.
    committed Apr 19, 2012
Commits on Apr 14, 2012
  1. Exclude early versions of MiniTest gem from CI for Ruby 1.9.3.

    Since Ruby 1.9.3 includes much later versions of MiniTest, excluding
    these doesn't seem to lose much value.
    committed Apr 14, 2012
Commits on Apr 13, 2012
  1. Merge pull request #75 from floehopper/alias-method-alternative

    Store original method rather than using alias_method.
    
    This should fix #41, #47, #74 and all tests should now pass on both Ruby 1.8.7 and 1.9.3.
    committed Apr 13, 2012
  2. MiniTest::Unit#run now seems to need an array of args.

    It seems like this is somehow backwardly compatible, but I haven't
    investigated closely. It may cause CI failures.
    committed Apr 13, 2012
  3. ClassMethod#hidden_method is no longer needed.

    This is because we no longer use alias_method to hide the original
    method; instead we store it in an instance variable and re-define it if
    appropriate.
    committed Apr 12, 2012
  4. AnyInstanceMethod no longer uses alias_method.

    - This brings it into line with ClassMethod & InstanceMethod which were
    changed in 1802fb936bc5a0cae46458b5f7e5b69e9dea6616. Storing the method
    in an instance variable seems like a more elegant solution and has the
    advantage of not changing the stubbed object's interface, albeit with an
    obfuscated method name.
    - As in ClassMethodTest, many tests in AnyInstanceTest are no longer
    appropriate for the new implementation and like many of the unit tests
    are in any case way too implementation-specific.
    - It should now be possible to remove ClassMethod#hidden_method, which
    was only being used by AnyInstanceMethod.
    committed Apr 12, 2012
  5. ClassMethod & InstanceMethod no longer use alias_method.

    - Instead of hiding the original method using alias_method, we can store
    it as an instance variable and re-define it later if appropriate.
    - Although all the tests are passing at this point, the tests in
    ClassMethodTest aren't all appropriate for the new implementation. In
    fact they are (like many of the unit tests) way too
    implementation-specific.
    - We also need to convert AnyInstanceMethod to work the same way. It
    should then be possible to remove ClassMethod#hidden_method.
    committed Apr 12, 2012
  6. Provide a mechanism to run multiple test method.

    It's sometimes useful to be able to run multiple tests from within a
    single acceptance test. This is now possible using
    TestRunner#run_as_tests and passing in multiple Proc objects.
    committed Apr 13, 2012
  7. Never need to supply a test result to TestRunner#run_as_test.

    And in any case this doesn't work with MiniTest.
    committed Apr 13, 2012
Commits on Apr 11, 2012
  1. Prevent stubbing of methods on nil by default.

    - It seems very unlikely that anyone would ever intentionally stub
      a method on `nil`, since the instance of NilClass is effectively a
      singleton and stubbing a method will affect all "instances" of `nil`.
    - It is still possible to stub methods on `nil` by modifying the default
      `Configuration` setting for `:stubbing_method_on_nil`.
    - This should hopefully address some of the problems raised in #68.
    committed Apr 11, 2012
Commits on Apr 10, 2012
Something went wrong with that request. Please try again.