-
Notifications
You must be signed in to change notification settings - Fork 242
rake test did not work with 1.9.2 #73
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
Open
5v3n
wants to merge
15
commits into
cloudhead:master
Choose a base branch
from
5v3n:master
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
15 commits
Select commit
Hold shift + click to select a range
29670cd
added nbproject folder
8f8fd35
changed parameter sequence in Site's go method. Added test case for e…
a9af50e
waiting for the toto release with env access - so here's my prereleas…
4365d31
this version is hosted at rubygems.org (toto_prerelease)
9e3a6a5
changed instructions to install the prerelease.
5v3n 1dec520
fixed typo...
5v3n 8483d17
changed docu to support prerelease
5v3n 2ae74af
merging with cloudhead/toto
5v3n 55a54e9
added rvm support and resolved missed merge conflict
5v3n ba5032b
fix: rake test now works with both 1.8.7 and 1.9.2
5v3n 745934b
remove prerelease precautions from installation instructions
5v3n b139e4f
removed all prerelease precautions from installation instructions
5v3n dea8802
removed all prerelease precautions from installation instructions
5v3n 3de0681
removed prerelease precautions from installation instructions
5v3n 83b43c1
Merge branch 'master' of github.com:5v3n/toto
5v3n File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -3,3 +3,4 @@ | |
| coverage | ||
| rdoc | ||
| pkg | ||
| nbproject | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| rvm 1.9.2@toto |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this one-liner is all that's necessary to enable
rake teston 1.9.2 - still works on 1.8.7, I tested it.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removing this line renders me unable to run tests on 1.9.2.
The root cause of 1.9.2 not working is that Ruby removed . from the load path in 1.9.2. Changing the line to:
require File.expand_path File.join(File.dirname(FILE), 'test_helper')
fixes the include relative to the current file problem
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nope, works with 1.9.2 & ree:
$ rake test 1> /dev/null
/Users/svenkrauter/.rvm/rubies/ruby-1.9.2-p136/bin/ruby -I"lib:lib:test" "/Users/svenkrauter/.rvm/gems/ruby-1.9.2-p136@global/gems/rake-0.8.7/lib/rake/rake_test_loader.rb" "test/toto_test.rb"
$ rake test 1> /dev/null
/Users/svenkrauter/.rvm/rubies/ree-1.8.7-2010.02/bin/ruby -I"lib:lib:test" "/Users/svenkrauter/.rvm/gems/ree-1.8.7-2010.02/gems/rake-0.8.7/lib/rake/rake_test_loader.rb" "test/toto_test.rb"
Taking a look at the Rakefile you will notice that test.pattern is set correctly. I saw you are running a non *NIX OS, perhaps there's some adjustment needed to get going with Windows and the likes.
Cheers
5v3n
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi Sven,
I've looked at this again and the issue can be broadly summed up as "I'm an idiot". rake test works as expected once I stop doing stupid things as test.libs is setup correctly in the rake file.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi BP,
can't copy that - you do not seem like an idiot to me.
;-)
What was the cause then? "Stupid things" is not too far on the specific side.
Cheers
Sven Kräuter | 5v3n
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I know I'm not an idiot, I've just got a terrible habit of overstating my foolishness when I realise I haven't done something that should have been obvious :D
"Stupid things" was trying to run toto_test.rb directly using ruby test/toto_test.rb instead of using the rake file. Thus lib and test weren't added to the load path which caused require errors and you can see where it all went wrong from there.
Both your and my solutions fix root problem of the current dir not being in the load path; but I'm not sure which approach is better: your is simpler, mine lets you call the test file directly but do we want to let people to do that? Should we be saying the supported way to run tests in to use rake?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see :-)
Two quick answers:
rake testis the way to run the tests.require_relativewhich should come to your delight ;-).anyways, relative paths in ruby are a bit on the painful side - there's always pros & cons and to find the right thing is quite hard.