technicalpickles/jeweler — pull request #221 by aia (2012-01-24 08:57:17+00:00)
Title: Fixing rake test under ruby 1.9

Rake test was broken under ruby 1.9 in two places:

1. Outdated version of RR generating errors like the following

167) Error:
test: merging options should take options from each. (TestOptions):
NameError: undefined local variable or method `instance_methods' for #
/Users/artem/.rvm/gems/ruby-1.9.3-p0@jeweler/gems/rr-0.10.11/lib/rr/blank_slate.rb:6:in `block in call'
/Users/artem/.rvm/gems/ruby-1.9.3-p0@jeweler/gems/rr-0.10.11/lib/rr/blank_slate.rb:5:in `instance_eval'
/Users/artem/.rvm/gems/ruby-1.9.3-p0@jeweler/gems/rr-0.10.11/lib/rr/blank_slate.rb:5:in `call'
/Users/artem/.rvm/gems/ruby-1.9.3-p0@jeweler/gems/rr-0.10.11/lib/rr/double_definitions/double_definition_create_blank_slate.rb:6:in `initialize'
/Users/artem/.rvm/gems/ruby-1.9.3-p0@jeweler/gems/rr-0.10.11/lib/rr/double_definitions/double_definition_create.rb:117:in `new'
/Users/artem/.rvm/gems/ruby-1.9.3-p0@jeweler/gems/rr-0.10.11/lib/rr/double_definitions/double_definition_create.rb:117:in `add_strategy'
/Users/artem/.rvm/gems/ruby-1.9.3-p0@jeweler/gems/rr-0.10.11/lib/rr/double_definitions/double_definition_create.rb:87:in `add_verification_strategy'
/Users/artem/.rvm/gems/ruby-1.9.3-p0@jeweler/gems/rr-0.10.11/lib/rr/double_definitions/double_definition_create.rb:8:in `stub'
/Users/artem/.rvm/gems/ruby-1.9.3-p0@jeweler/gems/rr-0.10.11/lib/rr/adapters/rr_methods.rb:9:in `stub'
/Users/artem/work/jeweler/test/test_helper.rb:164:in `stub_git_config'
/Users/artem/work/jeweler/test/jeweler/generator/test_options.rb:7:in `setup'

2. test_write_gemspec comparing UTC time to local time zone.

rake test
/Users/artem/.rvm/rubies/ruby-1.9.3-p0/bin/ruby -I"lib:test" -I"/Users/artem/.rvm/gems/ruby-1.9.3-p0@jeweler/gems/rake-0.9.2.2/lib" "/Users/artem/.rvm/gems/ruby-1.9.3-p0@jeweler/gems/rake-0.9.2.2/lib/rake/rake_test_loader.rb" "test/jeweler/commands/test_build_gem.rb" "test/jeweler/commands/test_install_gem.rb" "test/jeweler/commands/test_release_to_gemcutter.rb" "test/jeweler/commands/test_release_to_git.rb" "test/jeweler/commands/test_release_to_github.rb" "test/jeweler/commands/test_validate_gemspec.rb" "test/jeweler/commands/test_write_gemspec.rb" "test/jeweler/commands/version/test_base.rb" "test/jeweler/commands/version/test_bump_major.rb" "test/jeweler/commands/version/test_bump_minor.rb" "test/jeweler/commands/version/test_bump_patch.rb" "test/jeweler/commands/version/test_write.rb" "test/jeweler/generator/test_application.rb" "test/jeweler/generator/test_options.rb" "test/jeweler/test_gemspec_helper.rb" "test/jeweler/test_generator.rb" "test/jeweler/test_generator_initialization.rb" "test/jeweler/test_generator_mixins.rb" "test/jeweler/test_specification.rb" "test/jeweler/test_tasks.rb" "test/jeweler/test_version_helper.rb" "test/test_jeweler.rb"
* DEFERRED: release_tagged? when no tag exists should be true.
* DEFERRED: release_tagged? when tag exists should be false.
* DEFERRED: release_tagged? when no tag exists should be true.
* DEFERRED: release_tagged? when tag exists should be false.
* DEFERRED: after run should output that the gemspec was written.
Run options:

# Running tests:

...........................................................F..................................................................................................................................................................................................--directory is deprecated and will be removed in 2.0.0. Please specify an absolute path to a directoy as the last argument instead
....................................................................................................................................................

Finished tests in 3.690012s, 108.9427 tests/s, 98.6447 assertions/s.

1) Failure:
test: after run should update gemspec date to the beginning of today. (Jeweler::Commands::TestWriteGemspec) [/Users/artem/work/jeweler/test/jeweler/commands/test_write_gemspec.rb:50]:
<2012-01-24 00:00:00 -0800> expected but was
<2012-01-24 00:00:00 UTC>.

402 tests, 364 assertions, 1 failures, 0 errors, 0 skips
rake aborted!
Command failed with status (1): [/Users/artem/.rvm/rubies/ruby-1.9.3-p0/bin...]

Tasks: TOP => test
(See full trace by running task with --trace)

The patches fix both cases.

rake test runs clean under ruby 1.9