Skip to content
Commits on Sep 14, 2015
  1. @raeno

    Fix documentation for #stub method

    raeno committed Sep 14, 2015
Commits on Mar 21, 2015
  1. @floehopper

    Extra debug output & exception message in MonkeyPatcher.

    This partially addresses #220 in that the exception raised in #219 would now be
    
        Unable to monkey-patch Test::Unit::TestCase, because it does not define a `#run` method (RuntimeError)
    
    I've assumed that in the cases where I've just added debug output, that the
    monkey patch has already been applied and there's a decent chance everything
    will work as intended.
    floehopper committed Mar 21, 2015
  2. @floehopper
Commits on Mar 15, 2015
  1. @floehopper

    Remove Test::Unit development dependency.

    I'm not convinced this dependency which was introduced in [1] is actually
    necessary.
    
    [1]: ce3a242
    floehopper committed Mar 15, 2015
  2. @lazyatom @floehopper

    Explicitly support matching `Hash` parameters with `includes`.

    The normal `Hash#includes?` method is a synonym for `has_key?`; this
    would've been the existing matcher behaviour prior to these changes.
    The new behaviour is that matchers can also now be given, and for
    `Hash` instances they will be matched against the keys of the hash.
    
    The `String` class in Ruby 1.8.7 responds to `all?`, yielding the
    whole string, but we actually want all `String` instances to use the
    basic `parameter.include?` code path.
    lazyatom committed with floehopper Mar 4, 2015
  3. @lazyatom @floehopper

    Add explicit tests for `includes` matcher with `String`s

    Previously, the `includes` matcher would work with any object that
    responds to `include?`, which included `String` instances. The
    previous change broke this because `String` doesn't respond to `any?`.
    lazyatom committed with floehopper Mar 4, 2015
  4. @lazyatom @floehopper

    Allow `includes` matcher to take matcher arguments.

    We should be able to created a matcher of the form:
    
        object.expects(:foo).with(includes(has_entry(:key, 'value')))
    
    and successfully match this against a method call like:
    
        object.foo([:a, :b, {:key => value}, :c])
    lazyatom committed with floehopper Mar 2, 2015
  5. @floehopper

    Invert sense of environment variable for generating docs.

    I was seeing an error in Travis CI builds for Ruby versions earlier than 1.9.2:
    
        An error occurred while installing redcarpet (3.2.2), and Bundler cannot continue.
    
    This was happening because I'd forgotten to include the `MOCHA_NO_DOCS`
    environment variable in the more specific builds (i.e. in `matrix[include]`) in
    `.travis.yml`.
    
    Instead of adding this environment variable to all the builds, I've elected to
    invert the logic.
    floehopper committed Mar 15, 2015
Commits on Mar 14, 2015
  1. @floehopper
  2. @floehopper

    Add Test::Unit as a development dependency.

    I was seeing the following exception on Travis CI builds with Ruby 2.2:
    
        test/test_helper.rb:43:in `require': cannot load such file -- test/unit (LoadError)
    
    e.g. in https://travis-ci.org/freerange/mocha/jobs/54347342
    
    I haven't been able to reproduce the problem locally, but I'm hoping this
    change will fix it.
    floehopper committed Mar 14, 2015
  3. @floehopper

    Apply all env vars to all Travis CI builds.

    Previously these env vars contributed to the matrix of builds which is not
    what I had intended.
    floehopper committed Mar 14, 2015
  4. @floehopper

    Do not generate docs in Travis CI builds.

    * Prevents error installing Redcarpet on Ruby 1.8.7
    * Same as the build matrix script
    * Not necessary
    floehopper committed Mar 14, 2015
  5. @floehopper

    Remove version restriction on Redcarpet.

    I was seeing the following exception when trying to generate the docs:
    
        NoMethodError: undefined method `lax_spacing=' for #<RedcarpetCompat:0x007f9a643a85f8>
    
    As of Yard v0.7.4 [1], we no longer need the restriction on the version of
    Redcarpet which was introduced in this commit [2] and this restriction seems
    to be what's causing the exception mentioned above.
    
    It's possible that we could now remove the dependency on Redcarpet altogether,
    because I think Yard now had a built-in markdown processor. However, I haven't
    managed to convince myself that such a removal doesn't break some formatting
    somewhere, so this seems like the best option for now.
    
    [1]: https://github.com/lsegal/yard/blob/master/CHANGELOG.md#074---december-2-2011
    [2]: 4dae54c
    floehopper committed Mar 14, 2015
Commits on Mar 2, 2015
  1. @floehopper

    Run latest versions of Ruby v2.1 and v2.2 in Travis CI.

    Ruby has supported semantic versioning since v2.1 and this should mean it's
    safe to run the latest patch version of a given major/minor version. What's
    more this will give us an earlier heads up if an incompatibility has been
    inadvertently introduced.
    
    Thanks to @sanemat for his suggestion in #216.
    floehopper committed Mar 2, 2015
  2. @floehopper

    Remove MiniTest version constraint from gem spec.

    This is a bodgy way to make the performance tests work a bit (after a fashion)
    with MiniTest v5. It's not ideal, because there's no longer a global way to
    set the output/reporter nor a way to disable MiniTest's autorun mechanism, so
    we see some unhelpful output about running 0 tests at the end.
    
    However, I haven't really been keeping an eye on this benchmark for some time
    and it's not currently part of the Travis CI build, so it doesn't seem hugely
    important. It seems *more* important to remove the gem spec constraint so that
    Travis CI builds will run against the latest versions of MiniTest.
    floehopper committed Mar 2, 2015
  3. @floehopper
  4. @floehopper

    Constrain version of MiniTest in gem spec to v4.x.

    Some major changes happened between MiniTest v4 and v5 and I was seeing
    exceptions like this one when running the performance tests:
    
        Benchmarking with 1000 iterations...
        rake aborted!
        NoMethodError: undefined method `output=' for Minitest::Unit:Class
        /Users/jamesmead/Code/freerange/mocha/Rakefile:94:in `benchmark_test_case'
        /Users/jamesmead/Code/freerange/mocha/Rakefile:84:in `block (3 levels) in <top (required)>'
        /Users/jamesmead/Code/freerange/mocha/Rakefile:83:in `each'
        /Users/jamesmead/Code/freerange/mocha/Rakefile:83:in `block (2 levels) in <top (required)>'
        Tasks: TOP => default => test:performance
        (See full trace by running task with --trace)
    
    This is because we're relying on bits of MiniTest which no longer exist in the
    same form.
    
    Rather than addressing these problems now, I'm adding a constraint to the gem
    spec file in an effort to get the Travis CI build passing under Ruby v2.2 as
    soon as possible. It's possible that we'll run into issues with the
    MiniTest-specific Gemfiles, but let's see!
    floehopper committed Mar 2, 2015
  5. @floehopper

    As of Ruby v2.2, nil is frozen so these tests are irrelevant.

    In all these scenarios in the latest versions of Ruby, a `Mocha::StubbingError`
    will be raised with the message: "can't stub method on frozen object: nil".
    
    This behaviour is already tested in the more generic `StubbingFrozenObjectTest`
    and so it's safe to ignore these tests for the relevant versions of Ruby.
    floehopper committed Mar 2, 2015
  6. @floehopper

    As of Ruby v2.2, there are no test libs in the standard library.

    Both Test::Unit and MiniTest were removed [1] from the standard library in
    Ruby v2.2.
    
    Since Mocha relies on the presence of either Test::Unit or MiniTest to run its
    tests, this commit makes MiniTest an explicit development dependency for
    versions of Ruby which do not make it available by default.
    
    [1]: https://bugs.ruby-lang.org/issues/9711#note-12
    floehopper committed Mar 2, 2015
Commits on Dec 8, 2014
  1. @jaredbeck

    Fix typo in readme

    jaredbeck committed Dec 8, 2014
Commits on Jun 23, 2014
  1. @chrisroos

    Allow gofreerange.com host to be changed in Rakefile

    This makes it possible to publish the docs to another host, which is
    useful while I'm trying to get another server configured.
    chrisroos committed Jun 23, 2014
Commits on Jun 19, 2014
  1. @floehopper

    No need to update rubygems on Travis CI any more.

    This `before_install` block was added in [1], because of a bug in the version
    of Rubygems provided by Travis CI by default (v2.2.0). We need a fix which is in
    Rubygems v2.2.1 and the default version provided by Travis CI is now v2.2.2.
    
    [1] 3128fb8
    floehopper committed Jun 19, 2014
  2. @floehopper

    Allow stubbing method to which any instance responds.

    Fixes #200.
    
    Previously we were not calling `Object#respond_to?` on an instance of the
    class. By using `Object#allocate` we can instantiate an example instance of
    the class so we can interrogate it using `Object#respond_to?`.
    
    Obviously this is not perfect, given that a method might be defined in the time
    between stubbing and invocation, but it means that both
    `Mocha::ObjectMethods#method_exists?` and `Mocha:ClassMethods#method_exists?`
    now work in a similar way.
    floehopper committed Jun 19, 2014
Commits on Jun 6, 2014
  1. @floehopper
Commits on May 13, 2014
  1. @floehopper
  2. @floehopper

    Set visibility of any instance stub method.

    This omission was drawn to my attention by @mrsimo in [1].
    
    [1] mrsimo@2b08787#lib-mocha-any_instance_method-rb-P21
    floehopper committed May 13, 2014
  3. @floehopper
Commits on May 12, 2014
  1. @mrsimo @floehopper
Commits on Feb 20, 2014
  1. @floehopper
Commits on Feb 13, 2014
  1. @floehopper
Commits on Jan 20, 2014
  1. @10io

    Fix typos [ci skip]

    10io committed Jan 20, 2014
Commits on Jan 11, 2014
  1. @floehopper

    Update version to v1.0.0.

    [ci skip]
    floehopper committed Jan 11, 2014
  2. @floehopper

    Updates to README.md for v1.0.0.

    [ci skip]
    floehopper committed Jan 11, 2014
  3. @floehopper

    Another tweak to RELEASE.md.

    [ci skip]
    floehopper committed Jan 11, 2014
  4. @floehopper

    Tweaks to RELEASE.md.

    Group internal & external changes.
    
    [ci skip]
    floehopper committed Jan 11, 2014
Something went wrong with that request. Please try again.