Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

missing test_helper #1

Closed
gs opened this issue Oct 31, 2011 · 15 comments
Closed

missing test_helper #1

gs opened this issue Oct 31, 2011 · 15 comments

Comments

@gs
Copy link

gs commented Oct 31, 2011

I have installed spin and kicker

I am using rails 2.3.14 and copied environment.rb to application.rb

Spin and kicker started successful, but error occures when trying to run a test:

Executing: ruby -r test/functional/user_controller_test.rb -e ''
./test/functional/user_controller_test.rb:1:in `require': no such file to load -- test_helper (LoadError)
from ./test/functional/user_controller_test.rb:1

Not sure if this is Spin or Kicker issue.

Please check,
Grzegorz

@jstorimer
Copy link
Owner

This is a load path issue. I'll have to add a -I flag to the spin binary just like Ruby supports.

In the meantime you can add the test/ directory to your load path with

export RUBYLIB=test

@jstorimer
Copy link
Owner

Also, copying environment.rb to application.rb will likely not give you the results you want. This tool wasn't build with Rails 2.x support in mind, though I'd be happy to accept a patch that added it.

Read here for more about why this won't work as expected: http://jstorimer.github.com/spin/#section-9

@gs
Copy link
Author

gs commented Nov 1, 2011

Hey,

where exactly shall I add this

export RUBYLIB=test

I've tried to add it into my .bash_profile in above way or with full path to test folder but then I get totally different error
`load_missing_constant': uninitialized constant Rails::Plugin::Synthesis::AssetPackageHelper (NameError).

This tools seems to me awesome as it really speed up! But have to figure out why it does not work for me.

Br,
Grzegorz

@jstorimer
Copy link
Owner

You don't need the RUBYLIB hack anymore. As of version 0.1.3 you can use the -I argument when booting up the server.

spin serve -Itest

@gs
Copy link
Author

gs commented Nov 2, 2011

Hey,

Thanks for implementing this but after update of spin I get

Executing: spin push -r test/functional/user_controller_test.rb -e ''
/Users/grzegorz/.rvm/rubies/ree-1.8.7-2011.03/lib/ruby/1.8/optparse.rb:1450:in complete': invalid option: -e (OptionParser::InvalidOption) from /Users/grzegorz/.rvm/rubies/ree-1.8.7-2011.03/lib/ruby/1.8/optparse.rb:1448:incatch'
from /Users/grzegorz/.rvm/rubies/ree-1.8.7-2011.03/lib/ruby/1.8/optparse.rb:1448:in complete' from /Users/grzegorz/.rvm/rubies/ree-1.8.7-2011.03/lib/ruby/1.8/optparse.rb:1287:inparse_in_order'
from /Users/grzegorz/.rvm/rubies/ree-1.8.7-2011.03/lib/ruby/1.8/optparse.rb:1254:in catch' from /Users/grzegorz/.rvm/rubies/ree-1.8.7-2011.03/lib/ruby/1.8/optparse.rb:1254:inparse_in_order'
from /Users/grzegorz/.rvm/rubies/ree-1.8.7-2011.03/lib/ruby/1.8/optparse.rb:1248:in order!' from /Users/grzegorz/.rvm/rubies/ree-1.8.7-2011.03/lib/ruby/1.8/optparse.rb:1339:inpermute!'
from /Users/grzegorz/.rvm/rubies/ree-1.8.7-2011.03/lib/ruby/1.8/optparse.rb:1360:in parse!' from /Users/grzegorz/.rvm/gems/ree-1.8.7-2011.03@qype/gems/spin-0.1.3/bin/spin:141 from /Users/grzegorz/.rvm/gems/ree-1.8.7-2011.03@qype/bin/spin:19:inload'
from /Users/grzegorz/.rvm/gems/ree-1.8.7-2011.03@qype/bin/spin:19

09:53:20.38 | Failed (256)

Could you please check it?

@jstorimer
Copy link
Owner

Thanks for the report, I fixed the problem in version 0.1.4. Can you try that?

@gs
Copy link
Author

gs commented Nov 2, 2011

Hey!

Thx for fixing it and now I get no error :). Which is good.
As this was not designed to work with Rails 2 maybe thats the problem as when I run now
spin serve -Itest

and

spin push test/functional/user_controller_test.rb

then the message is:
Loading ["test/functional/user_controller_test.rb"]

No examples found.

Finished in 0.00005 seconds
0 examples, 0 failures

and same when I run the kicker

kicker -r rails -b "spin push"
16:33:42.59 | Watching for changes on: /Users/grzegorz/Work/qype/main/qype
16:33:42.59 |
16:33:46.27 | Executing: spin push -r test/functional/user_controller_test.rb -e ''

Spinning up test/functional/user_controller_test.rb

16:33:46.39 | Success

and

No examples found.

Finished in 0.00006 seconds
0 examples, 0 failures

any ideas?

@jstorimer
Copy link
Owner

What test framework are you using here? RSpec?

@gs
Copy link
Author

gs commented Nov 3, 2011

No, these are normal unit tests.

@jstorimer
Copy link
Owner

The tool wasn't built with Rails 2 in mind, and I don't have a Rails 2 app handy that I can test with. The discussion going on in #5 might lead to a solution for Rails 2.

In the meantime can you share your Rails 2 app? Or provide a simple set of instructions to reproduce the issue on Rails 2?

@gs
Copy link
Author

gs commented Nov 4, 2011

Hey!

Thanks,
I've cloned the repo from @mathiewul and it worked.

I like the idea of loading once the rails env and then speed up the tests. I am coauthor of
https://github.com/maltize/sublime-text-2-ruby-tests and I would like to integrate spin & run test faster (the single file and single test from file)

As in project that I work with running tests takes ages.

@jstorimer
Copy link
Owner

Cool. I'm not a sublime user or a pythonista, but if I can be of any help let me know :)

@gs
Copy link
Author

gs commented Nov 5, 2011

Hey!

So it would be great if I could run spin like:

spin push test/unit/user_test.rb -n /user_login_test/

Then I would run only single test from file.
Also is it possible to integrate spin with growl-notifier? So then I could see the results after finish.

What do you think about those stuff?

@jstorimer
Copy link
Owner

See #9

@jstorimer
Copy link
Owner

I'm pretty hesitant about integrating growl since it's OSX specific. I'd prefer to implement some kind of hook system so you can do notifications any way you want.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants