Skip to content

Commit

Permalink
irt rake common task
Browse files Browse the repository at this point in the history
- fixed a few problems
- added rvm automatic support
  • Loading branch information
ddnexus committed Jan 7, 2012
1 parent 0bfa6c3 commit 3447667
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 5 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,4 @@ dryml/lib/doc
doc
dryml/doc
.yardoc
.rvmrc
9 changes: 6 additions & 3 deletions hobo/test/irt/readme.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
In order to run the tests, you need git and irt installed, then run:

$ rake irt_test_all
$ rake test:irt

or if you are testing a local repo of hobo, from the hobo repo root:
or if you are testing a local repo of hobo, you need to set the:

$ rake HOBO_DEV_ROOT=. irt_test_all
$ export HOBODEV=<hobo_repo_root_path>

With HOBODEV set, if you are using rvm, the <hobo_repo_root_path>/.rvmrc file will be duplicated into
the created testapp, so your test will use the same rvm settings.
15 changes: 13 additions & 2 deletions hobo_support/lib/hobo_support/common_tasks.rb
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,20 @@ module HoboSupport
task :prepare_testapp, :force do |t, args|
if args.force || !File.directory?(TESTAPP_PATH)
remove_entry_secure( TESTAPP_PATH, true )
sh %(#{BIN} new #{TESTAPP_PATH} --skip-wizard)
sh %(#{BIN} new #{TESTAPP_PATH} --skip-wizard --skip-bundle)
chdir TESTAPP_PATH
sh %(echo "gem 'irt', :group => :console" >> Gemfile) # to make the bundler happy
if ENV['HOBODEV']
rvmrc_path = File.join(ENV['HOBODEV'], '.rvmrc')
if File.exist?(rvmrc_path)
puts %(Copying .rvmrc file)
copy_file rvmrc_path, './.rvmrc'
sh %(rvm reload) do |ok|
puts 'rvm command skipped' unless ok
end
end
end
sh %(bundle install --local)
sh %(echo "gem 'irt', :group => :development" >> Gemfile) # to make the bundler happy
sh %(echo "" > app/models/.gitignore) # because git reset --hard would rm the dir
rm %(.gitignore) # we need to reset everything in a testapp
sh %(git init && git add . && git commit -m "initial commit")
Expand Down

0 comments on commit 3447667

Please sign in to comment.