Skip to content

Commit

Permalink
Be compatible with RSpec 2.
Browse files Browse the repository at this point in the history
  • Loading branch information
jeffschuil committed Dec 30, 2010
1 parent b23ebd5 commit b04188f
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 13 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
.DS_Store
pkg
.rvmrc
*~
28 changes: 22 additions & 6 deletions Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,28 @@ rescue LoadError
puts "Jeweler (or a dependency) not available. Install it with: gem install jeweler"
end

require 'spec/rake/spectask'
task :default => :spec
desc "Run all specs"
Spec::Rake::SpecTask.new do |t|
t.spec_files = FileList['spec/**/*_spec.rb']
t.spec_opts = ['--options', 'spec/spec.opts']
begin
# Rspec 1.3
require 'spec/rake/spectask'
task :default => :spec
desc "Run all specs"
Spec::Rake::SpecTask.new do |t|
t.spec_files = FileList['spec/**/*_spec.rb']
t.spec_opts = ['--options', 'spec/spec.opts']
end

rescue LoadError
# RSpec 2
require 'rspec/core/rake_task'
task :default => :spec
desc "Run all specs"
RSpec::Core::RakeTask.new do |t|
t.pattern = "spec/**/*_spec.rb"
t.rspec_opts = %w(-fs --color)
end

rescue LoadError
puts "Rspec not available. Install it with: gem install rspec"
end

require 'rake/rdoctask'
Expand Down
8 changes: 1 addition & 7 deletions spec/spec_helper.rb
Original file line number Diff line number Diff line change
@@ -1,20 +1,14 @@
ENV["RAILS_ROOT"] ||= File.dirname(__FILE__) + '/../../../..'
ENV["RAILS_ENV"] = "test"

#require File.expand_path(File.dirname(ENV['RAILS_ROOT']) + "/config/environment")
require 'rubygems'
require 'spec'

require 'active_record'
require 'action_controller'
require 'action_view'


require 'event_calendar'
require 'event_calendar/calendar_helper'

require File.dirname(__FILE__) + '/../init.rb'
require 'spec/fixtures/models'
require File.dirname(__FILE__) + "/fixtures/models"

ActiveRecord::Base.establish_connection(:adapter => 'sqlite3', :database => ':memory:')
ActiveRecord::Migration.verbose = false
Expand Down

0 comments on commit b04188f

Please sign in to comment.