Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
switch run specs to using standard update & install paradigm, and upd…
…ate README.
  • Loading branch information
ronen committed Aug 14, 2011
1 parent 2aeb86c commit 7f01251
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 5 deletions.
7 changes: 3 additions & 4 deletions README.rdoc
Expand Up @@ -147,14 +147,13 @@ running. Create database user "schema_plus" with permissions for database
$ bundle install
$ rake postgresql:build_databases
$ rake mysql:build_databases
$ ./runspecs --install # do this once to install gem dependencies for all versions (slow)
$ ./runspecs --install # do this once, it runs 'bundle install' for all versions (slow)
$ ./runspecs # as many times as you like

See <tt>./runspecs --help</tt> for more options. You can also manually pick a specific version of rails and ruby to use, such as:
$ rvm use 1.9.2
$ export SCHEMA_ASSOCIATIONS_RAILS_VERSION=3.1
$ bundle update --local rails mysql2 # different versions of rails require different mysql2's
$ rake spec
$ export BUNDLE_GEMFILE==gemfiles/Gemfile.rails-3.1
$ bundle exec rake spec

And you can run the specs for a specific adapter:
$ rake postgresql:spec # to run postgresql tests only
Expand Down
9 changes: 8 additions & 1 deletion runspecs
Expand Up @@ -19,6 +19,10 @@ OptionParser.new do |opts|
o.dry_run = true
end

opts.on("--update", "Update gem dependencies") do |v|
o.update = v
end

opts.on("--install", "Install gem dependencies") do |v|
o.install = v
end
Expand Down Expand Up @@ -49,7 +53,10 @@ OptionParser.new do |opts|

end.parse!

cmd = if o.install
cmd = case
when o.update
"bundle update"
when o.install
"bundle install"
else
"bundle exec rake #{o.db_adapters.join(":spec ")}:spec"
Expand Down

0 comments on commit 7f01251

Please sign in to comment.