Skip to content

Commit

Permalink
Some spec housekeeping. Starting a TESTING doc for sunspot_rails, upd…
Browse files Browse the repository at this point in the history
…ated some gem dependencies.
  • Loading branch information
nz committed Sep 17, 2010
1 parent 24f59c8 commit ce32de2
Show file tree
Hide file tree
Showing 6 changed files with 44 additions and 226 deletions.
1 change: 1 addition & 0 deletions .gitignore
@@ -1 +1,2 @@
*.gem
Gemfile.lock
22 changes: 22 additions & 0 deletions sunspot_rails/TESTING.md
@@ -0,0 +1,22 @@
# Testing `sunspot_rails`

Note: All the paths mentioned in here are relative to the current directory, or `sunspot/sunspot_rails`.

The `sunspot_rails` gem is tested with RSpec, and its spec suite is located in `spec`.

These specs are to be run against up to date Rails 2 and Rails 3 applications, included at `spec/rails2` and `spec/rails3`, respectively. The `spec_helper.rb` file loads the environment for these applications based on the `RAILS_ROOT` provided when invoking tests, outlined below.

## Install dependencies

Each application uses Bundler to manage its dependencies. The `Gemfile` also installs the `sunspot` and `sunspot_rails` gems from your copies checked out locally. Because Bundler expands the full path to `sunspot` and `sunspot_rails`, we're excluding its generated `Gemfile.lock` file from version control.

cd spec/rails2
bundle install
cd ../rails3
bundle install
cd ../../

## Invoke specs

BUNDLE_GEMFILE=spec/rails2/Gemfile RAILS_ROOT=spec/rails2/ bundle exec spec spec/
BUNDLE_GEMFILE=spec/rails3/Gemfile RAILS_ROOT=spec/rails3/ bundle exec rspec spec/
14 changes: 11 additions & 3 deletions sunspot_rails/spec/rails2/Gemfile
@@ -1,10 +1,18 @@
source :rubygems

gem 'rails', '= 2.3.4'
gem 'rails', '~> 2.3.8'
gem 'sqlite3-ruby', '~> 1.3.1'

gem 'sunspot', :path => File.expand_path('../../../../sunspot', __FILE__)
gem 'sunspot_rails', :path => File.expand_path('../../..', __FILE__)
gem 'sqlite3-ruby', '~> 1.3.1'

group :test do
gem 'rspec-rails', '~> 1.3.0'
gem 'ruby-debug', :require => nil

if RUBY_VERSION.to_f >= 1.9
gem 'ruby-debug19', :require => nil
gem 'test-unit', '1.2.3'
else
gem 'ruby-debug', :require => nil
end
end
89 changes: 0 additions & 89 deletions sunspot_rails/spec/rails2/Gemfile.lock

This file was deleted.

13 changes: 10 additions & 3 deletions sunspot_rails/spec/rails3/Gemfile
@@ -1,10 +1,17 @@
source :rubygems

gem 'rails', '= 3.0.0.beta4'
gem 'rails', '~> 3.0.0'
gem 'sunspot', :path => File.expand_path('../../../../sunspot', __FILE__)
gem 'sunspot_rails', :path => File.expand_path('../../..', __FILE__)
gem 'sqlite3-ruby', '~> 1.3.1'

group :test do
gem 'rspec-rails', '= 2.0.0.beta.19'
gem 'ruby-debug', :require => nil
gem 'rspec-rails', '~> 2.0.0.beta.22'

if RUBY_VERSION.to_f >= 1.9
gem 'ruby-debug19', :require => nil
gem 'test-unit', '1.2.3'
else
gem 'ruby-debug', :require => nil
end
end
131 changes: 0 additions & 131 deletions sunspot_rails/spec/rails3/Gemfile.lock

This file was deleted.

0 comments on commit ce32de2

Please sign in to comment.