From 7f01251720c11cd8ab35d65986956939e9046f7b Mon Sep 17 00:00:00 2001 From: ronen barzel Date: Sun, 14 Aug 2011 13:52:44 -0700 Subject: [PATCH] switch run specs to using standard update & install paradigm, and update README. --- README.rdoc | 7 +++---- runspecs | 9 ++++++++- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/README.rdoc b/README.rdoc index c16907d..e8782c0 100644 --- a/README.rdoc +++ b/README.rdoc @@ -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 ./runspecs --help 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 diff --git a/runspecs b/runspecs index e2fe26b..095cb15 100755 --- a/runspecs +++ b/runspecs @@ -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 @@ -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"