Permalink
Commits on Aug 6, 2017
  1. Tests: relax required version of test-unit

    chrisk committed Aug 6, 2017
    `gem build` kindly reminded me that "WARNING:  pessimistic dependency on
    test-unit (~> 3.2.4, development) may be overly strict". I checked versions
    3.2.0 through 3.2.3 for compatibility, and it was right.
Commits on Jul 26, 2017
  1. Start updating the CHANGELOG for release

    chrisk committed Jul 26, 2017
    (This is not the complete listing, more to come.)
Commits on Jul 10, 2017
  1. Tests: update recent change to work on Rubinius

    chrisk committed Jul 10, 2017
    This modifies the Ruby 2.3-compat change in a770c77. Tested on
    Rubinius 3.82.
    
    References #56.
Commits on Jul 9, 2017
  1. Merge branch 'update-bufferedio-method-signature-for-24-compat'

    chrisk committed Jul 9, 2017
    * update-bufferedio-method-signature-for-24-compat:
      Update Net::BufferedIO patch for Ruby 2.4-compat
      Extract-method refactor
    
    Refernces #57 and #60.
  2. Update Net::BufferedIO patch for Ruby 2.4-compat

    chrisk committed Jul 9, 2017
    In Ruby 2.4, Net::BufferedIO's method signature changed to:
    
        def initialize(io, read_timeout: 60, continue_timeout: nil, debug_output: nil)
    
    Before that, it was just:
    
        def initialize(io)
    
    Our around-advice-style monkey-patch wraps this method, so it needs to pass the
    arguments through transparently. Ideally, we could just do this:
    
        def initialize_with_fakeweb(*args, **opts)
    
    But this causes a syntax error on earlier Rubies. Using an eval like this is the
    only way I can think of to work around this.
    
    This fixes exceptions like:
    
        NoMethodError: undefined method `<<' for {:read_timeout=>60,
          :continue_timeout=>nil, :debug_output=>nil}:Hash
    
    Thanks to @SamMolokanov for reporting in #60.
Commits on Jul 6, 2017
  1. Extract-method refactor

    chrisk committed Jul 6, 2017
    I'm going to wrap the BufferedIO.new monkey-patch in an eval in the next commit,
    so it seems better to have to eval as little code as possible.
Commits on Jun 29, 2017
  1. Merge branch 'update-dev-deps-for-old-ruby-compat'

    chrisk committed Jun 29, 2017
    * update-dev-deps-for-old-ruby-compat:
      Tests: just skip coverage on Ruby 1.9.0-1.9.2
      Hold back RDoc version on Ruby 1.9.2 and earlier
      Tests: fix a spurious failure on 1.8.7
      Tests: bump compatible Rubies to the latest Rake
      Reorganize the dev. dependencies in the gemspec
      Reformat comments in gemspec
    
    References #57.
  2. Tests: just skip coverage on Ruby 1.9.0-1.9.2

    chrisk committed Jun 28, 2017
    Before 1.9.3, SimpleCov raises a lot of exceptions in source_file.rb
    (`with_index': wrong number of arguments(1 for0) (ArgumentError)).
    
    (This adds that #defined? check in start_simplecov.rb because RUBY_ENGINE
    wasn't available on 1.8.7. The short-circuit in the old code made this
    unnecessary before.)
  3. Tests: fix a spurious failure on 1.8.7

    chrisk committed Jun 28, 2017
    Some warnings on Ruby 1.8.x use relative paths, which this didn't match.
  4. Tests: bump compatible Rubies to the latest Rake

    chrisk committed Jun 29, 2017
    On earlier Rubies,
    * exclude versions of Rake that mistakenly removed 1.8 compatibility
    * hold Ruby 1.9.0-1.9.2 to Rake 10.0 series
    * allow Ruby 1.8.7 to use older Rake versions, incl. the one it shipped with
  5. Reorganize the dev. dependencies in the gemspec

    chrisk committed Jun 29, 2017
    I make some of the Ruby version checks/exclusions more complicated in a
    subsequent commit, and grouping everything by dependency (rather than by
    set of Ruby versions) makes that easier to follow. This commit itself is
    a no-op.
  6. Reformat comments in gemspec

    chrisk committed Jun 29, 2017
Commits on Jun 28, 2017
  1. Merge branch 'master-leftovers-from-2014'

    chrisk committed Jun 28, 2017
    * master-leftovers-from-2014:
      Update to latest test-unit gem under rubinius
    
    This commit (along with some other stuff I already merged) was sitting
    on my local master branch from back in 2014. Not sure why I never pushed
    this. Will investigate Rubinius compatibility for real in a bit.
Commits on Jun 27, 2017
  1. Merge branch 'jruby-updates'

    chrisk committed Jun 27, 2017
    * jruby-updates:
      Tests: modernize JRuby runtime configuration
      Tests: JRuby now bundles its OpenSSL gem
    
    This gets everything working on JRuby 9000.
    
    References #57.
  2. Tests: modernize JRuby runtime configuration

    chrisk committed Jun 27, 2017
    Part of the configuration formerly enabled by --debug has been moved
    into another option, --dev. The new option also optimizes the runtime
    for fast startup, which is nice for our tests. For more, see:
    https://github.com/jruby/jruby/wiki/Improving-startup-time
  3. Tests: JRuby now bundles its OpenSSL gem

    chrisk committed Jun 27, 2017
    This dependency was resolving to an older version. Letting JRuby use
    its included version fixes that requiring 'net/https' would raise:
    "LoadError: no such file to load -- krypt/ossl"
Commits on Jun 26, 2017
  1. Merge branch 'add-stub-socket-close'

    chrisk committed Jun 26, 2017
    * add-stub-socket-close:
      Change stub socket for Ruby 2.4 compat
      Rename test class
    
    References #57.
  2. Change stub socket for Ruby 2.4 compat

    chrisk committed Jun 24, 2017
    Background:
    
    1.  As of Ruby 2.2, calling #close on a socket that's already closed
        no longer raises an exception.
    
    2.  As of Ruby 2.4, Net::HTTP no longer checks #closed? every time
        before calling #close on a socket, since there's no longer any
        danger it will raise. See:
    
        * r56795 (ruby/ruby@6394b63)
        * r56865 (ruby/ruby@f845a9e)
    
    FakeWeb's internal StubSocket has been short-circuiting those pre-2.4
    checks by just always returning true when #closed? is checked,
    preventing #close from ever being called.
    
    Now that the checks are gone, StubSocket needs its own #close
    method. This fixes a variety of NoMethodErrors on Ruby 2.4, but is
    basically backwards-compatible with earlier implementations.
    
    (When running on pre-Ruby 2.2, I suppose StubSocket should raise when
    you call #close on an already-closed socket. I'll look into that, but
    all our functional tests are passing on earlier Rubies at the moment.)
    
    While we're at it, I changed #closed? to stop just always returning
    true, to be closer to how the Ruby stdlib's sockets behave. This
    doesn't appear to break anything but I'll revert that part if I find
    anything in the relevant Net::HTTP code that conflicts.
    
    Thanks for reporting and submitting patches: @voxik in #59,
    @SamMolokanov in #60.
    
    Closes #59.
  3. Rename test class

    chrisk committed Jun 24, 2017
    ...to make a place for the tests in the subsequent commit.
Commits on Jun 23, 2017
  1. Merge branch 'update-net-http-mocks-for-ruby-2.3'

    chrisk committed Jun 23, 2017
    * update-net-http-mocks-for-ruby-2.3:
      Add explanatory comment to test helper
      net/http uses connect_nonblock since 2.3.0
    
    Thanks to @zeha for patching this in #56, and also to @davidcornu for
    the version in #58.
    
    This gets us all green on MRI Ruby 2.3 and below.
    
    Closes #56.
    References #57.
Commits on Jun 21, 2017
  1. Merge branch 'add-new-argument-check'

    chrisk committed Jun 21, 2017
    * add-new-argument-check:
      Simplify test by removing irrelevant fixture
      Tests: fix URI to really be invalid for Ruby 2.2
      Raise if .register_uri isn't given an options hash
    
    Closes #53.
    References #57.
  2. Tests: fix URI to really be invalid for Ruby 2.2

    chrisk committed Jun 21, 2017
    As of Ruby 2.2, URI supports parsing domain names that use the new
    generic top-level domains (gTLDs), such as .info, .tech, etc.  Although
    .txt is not an active TLD, URI no longer concerns itself with this
    problem and now only raises a URI::InvalidURIError when a domain name is
    syntactically invalid. So this test only worked on older Rubies.
    
    Thanks to @davidcornu for reporting and suggesting a new string to use
    in #58. Thanks also to @strzibny for reporting in #53.
  3. Raise if .register_uri isn't given an options hash

    chrisk committed Jun 21, 2017
    The existing test below, #register_uri_without_domain_name, was
    mistakenly constructed to call FakeWeb.register_uri with a string for
    the third argument rather than an options hash as in all other
    invocations. This was masked by the invalid second argument (trying to
    use 'test_example2.txt' as a domain name) because FakeWeb checks that
    first.
    
    As of Ruby 2.2, URI supports parsing domain names that use the new
    generic top-level domains (gTLDs), such as .info, .tech, etc.  Although
    .txt is not an active TLD, URI no longer concerns itself with this
    problem and now only raises a URI::InvalidURIError when a domain name is
    syntactically invalid. So starting with Ruby 2.2, the error in this test
    was no longer masked.
    
    It started raising this instead:
    
        TypeError(<no implicit conversion of Symbol into Integer>)
    
    ...because it was trying to treat the String argument as a Hash
    internally.
    
    Since that error isn't very intuitive, this adds an explicit check for
    passing non-hashy objects where a hash of response options is expected,
    raising an ArgumentError instead.
    
    Thanks for reporting: @strzibny in #53, @davidcornu in #58.
Commits on Jun 19, 2017
Commits on Jun 17, 2017
  1. Docs: remove option that only works with sdoc

    chrisk committed Jun 17, 2017
    Plain RDoc is used for older Rubies not supported by sdoc.
Commits on Jun 15, 2017
  1. Make sure Rakefile loads with old versions of rake

    chrisk committed Jun 15, 2017
    At a bare minimum, I like for invoking `rake` to always work, even if
    all it can do is tell you to install and run Bundler.
    
    Older versions of Rake -- like what's distributed with Ruby 1.9.3
    (v0.9.2.2) -- didn't have Rake::Task#clear_comments, so this would
    raise a NoMethodError. This works around that until the developer runs
    bundler, which will install a modern version of Rake.
  2. Tests: make sure RVM is available before using it

    chrisk committed Jun 13, 2017
    Checking the exit status of `command -v` should pretty much work
    everywhere. See e.g. https://stackoverflow.com/a/677212/54401 for a
    discussion.
    
    Thanks to @davidcornu for reporting this and suggesting an alternate
    fix in #58.
    
    References #57.