rake test:uncommitted raises undefined method map on String #713

Closed
lighthouse-import opened this Issue May 16, 2011 · 9 comments

2 participants

@lighthouse-import

Imported from Lighthouse. Original ticket at: http://rails.lighthouseapp.com/projects/8994/tickets/5397
Created by Sunny - 2011-02-19 09:28:20 UTC

Running the task test:uncommited raises an undefined method 'map' for String, using git.

$ rake --trace test:uncommitted
[...]
rake aborted!
undefined method `map' for #<String:0x8f3c728>
~/.gems/railties-3.0.0.beta4/lib/rails/test_unit/testing.rake:77:in `file_list'
[...]

My environment:

$ ruby -v
ruby 1.9.2dev (2010-07-30 revision 28788) [i686-linux]
$ rails -v
Rails 3.0.0.beta4
@lighthouse-import

Imported from Lighthouse.
Comment by Sunny - 2010-08-17 22:44:34 UTC

Patch that fixes this: http://github.com/sunny/rails/commit/22a13782b \o/

@lighthouse-import

Imported from Lighthouse.
Comment by Sunny - 2010-08-17 23:05:16 UTC

Attaching diff rather than github fork.

@lighthouse-import

Imported from Lighthouse.
Comment by Sunny - 2010-08-17 23:15:56 UTC

Added [#5397 state:resolved] to commit message.

@lighthouse-import

Imported from Lighthouse.
Comment by Sunny - 2011-01-17 22:00:48 UTC

This is a Ruby 1.9 issue. Strings don't come with .map() anymore so this task always fails.

@lighthouse-import

Imported from Lighthouse.
Comment by Josh Kalderimis - 2011-02-13 13:09:53 UTC

Hi Sunny,

I have spoken to José about this issue, and although your patch does fix it, the bigger issue at hand is that this code (rake task) isn't tested at all.

Ideally the code within def files should be extracted into its own class which is tested and then used in this rake task.

If you are still interested in working on this patch please let me know.

Thanks

Josh

@lighthouse-import

Imported from Lighthouse.
Comment by Sunny - 2011-02-16 13:19:29 UTC

I'm interested in working on this patch but I'm not very familiar with the Rails codebase. It might take long.

As for testing it, the tests would depend on svn and git. Is that ok for Rails?

@lighthouse-import

Imported from Lighthouse.
Comment by Josh Kalderimis - 2011-02-16 14:01:54 UTC

Hi Sunny,

This is a good patch to start off with.

And the tests won't need to depend on svn or git as we can stub out those parts.

Fork rails, create a new branch for what you are doing, and start making changes, if you have any questions do not hesitate to ask, you can also find me on irc in #rails-contrib.

I will leave the ticket assigned to me so I can monitor its progress.

Thanks

Josh

@lighthouse-import

Imported from Lighthouse.
Comment by Sunny - 2011-03-07 13:29:48 UTC

Thanks Josh! Started making a few changes in a testuncommited branch. Not sure I'm placing things where they should be and feeling somewhat stuck. Guess I need to crawl through the whole Rails test suite to find similar tests.

@docwhat

This still exists in rc4 with git.

$ rake test:uncommitted --trace
** Invoke test:uncommitted (first_time)
** Invoke test:prepare (first_time)
** Invoke db:test:prepare (first_time)
** Invoke db:abort_if_pending_migrations (first_time)
** Invoke environment (first_time)
** Execute environment
** Execute db:abort_if_pending_migrations
** Execute db:test:prepare
** Invoke db:test:load (first_time)
** Invoke db:test:purge (first_time)
** Invoke environment 
** Execute db:test:purge
** Execute db:test:load
** Invoke db:schema:load (first_time)
** Invoke environment 
** Execute db:schema:load
** Execute test:prepare
** Execute test:uncommitted
rake aborted!
undefined method `map' for #<String:0x000001034ef2b0>
/Users/docwhat/.rvm/gems/ruby-1.9.2-p290@chicagoiands/gems/railties-3.1.0.rc4/lib/rails/test_unit/testing.rake:109:in `file_list'
/Users/docwhat/.rvm/gems/ruby-1.9.2-p290@global/gems/rake-0.9.2/lib/rake/testtask.rb:126:in `file_list_string'
/Users/docwhat/.rvm/gems/ruby-1.9.2-p290@global/gems/rake-0.9.2/lib/rake/testtask.rb:99:in `block (2 levels) in define'
/Users/docwhat/.rvm/gems/ruby-1.9.2-p290@global/gems/rake-0.9.2/lib/rake/file_utils_ext.rb:57:in `verbose'
/Users/docwhat/.rvm/gems/ruby-1.9.2-p290@global/gems/rake-0.9.2/lib/rake/testtask.rb:98:in `block in define'
/Users/docwhat/.rvm/gems/ruby-1.9.2-p290@global/gems/rake-0.9.2/lib/rake/task.rb:205:in `call'
/Users/docwhat/.rvm/gems/ruby-1.9.2-p290@global/gems/rake-0.9.2/lib/rake/task.rb:205:in `block in execute'
/Users/docwhat/.rvm/gems/ruby-1.9.2-p290@global/gems/rake-0.9.2/lib/rake/task.rb:200:in `each'
/Users/docwhat/.rvm/gems/ruby-1.9.2-p290@global/gems/rake-0.9.2/lib/rake/task.rb:200:in `execute'
/Users/docwhat/.rvm/gems/ruby-1.9.2-p290@global/gems/rake-0.9.2/lib/rake/task.rb:158:in `block in invoke_with_call_chain'
/Users/docwhat/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/1.9.1/monitor.rb:201:in `mon_synchronize'
/Users/docwhat/.rvm/gems/ruby-1.9.2-p290@global/gems/rake-0.9.2/lib/rake/task.rb:151:in `invoke_with_call_chain'
/Users/docwhat/.rvm/gems/ruby-1.9.2-p290@global/gems/rake-0.9.2/lib/rake/task.rb:144:in `invoke'
/Users/docwhat/.rvm/gems/ruby-1.9.2-p290@global/gems/rake-0.9.2/lib/rake/application.rb:112:in `invoke_task'
/Users/docwhat/.rvm/gems/ruby-1.9.2-p290@global/gems/rake-0.9.2/lib/rake/application.rb:90:in `block (2 levels) in top_level'
/Users/docwhat/.rvm/gems/ruby-1.9.2-p290@global/gems/rake-0.9.2/lib/rake/application.rb:90:in `each'
/Users/docwhat/.rvm/gems/ruby-1.9.2-p290@global/gems/rake-0.9.2/lib/rake/application.rb:90:in `block in top_level'
/Users/docwhat/.rvm/gems/ruby-1.9.2-p290@global/gems/rake-0.9.2/lib/rake/application.rb:129:in `standard_exception_handling'
/Users/docwhat/.rvm/gems/ruby-1.9.2-p290@global/gems/rake-0.9.2/lib/rake/application.rb:84:in `top_level'
/Users/docwhat/.rvm/gems/ruby-1.9.2-p290@global/gems/rake-0.9.2/lib/rake/application.rb:62:in `block in run'
/Users/docwhat/.rvm/gems/ruby-1.9.2-p290@global/gems/rake-0.9.2/lib/rake/application.rb:129:in `standard_exception_handling'
/Users/docwhat/.rvm/gems/ruby-1.9.2-p290@global/gems/rake-0.9.2/lib/rake/application.rb:59:in `run'
/Users/docwhat/.rvm/gems/ruby-1.9.2-p290@global/gems/rake-0.9.2/bin/rake:32:in `<top (required)>'
/Users/docwhat/.rvm/gems/ruby-1.9.2-p290@global/bin/rake:19:in `load'
/Users/docwhat/.rvm/gems/ruby-1.9.2-p290@global/bin/rake:19:in `<main>'
Tasks: TOP => test:uncommitted

This is with:

$ ruby --version
ruby 1.9.2p290 (2011-07-09 revision 32553) [x86_64-darwin10.8.0]
$ rake --version
rake, version 0.9.2
$ rails --version
Rails 3.1.0.rc4
@arunagw arunagw added a commit to arunagw/rails that referenced this issue Jul 23, 2011
@arunagw arunagw Backporting from master fixes #713 e414d4f
@ttosch ttosch pushed a commit that referenced this issue Jan 19, 2015
@arunagw arunagw Backporting from master fixes #713 b29e3b6
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment