Skip to content

Commit

Permalink
Switching to Bundler and upgrading RSpec to v2.
Browse files Browse the repository at this point in the history
  • Loading branch information
pat committed Nov 13, 2010
1 parent 256a002 commit d7361fb
Show file tree
Hide file tree
Showing 8 changed files with 38 additions and 29 deletions.
2 changes: 2 additions & 0 deletions .gitignore
@@ -1,3 +1,5 @@
.bundle
Gemfile.lock
gem_deploy.rake
pkg
coverage
Expand Down
20 changes: 20 additions & 0 deletions Gemfile
@@ -0,0 +1,20 @@
source 'http://rubygems.org'

gem 'activerecord', '>= 1.15.6', '< 2.3.6'
gem 'riddle', '>= 1.0.10'
gem 'after_commit', '>= 1.0.7'

group :development do
gem 'mysql', '2.8.1'
gem 'pg', '0.9.0'
gem 'jeweler', '1.5.0.pre5'
gem 'yard', '0.6.1'
gem 'rspec', '2.0.1'
gem 'rspec-core', '2.0.1'
gem 'rspec-expectations', '2.0.1'
gem 'rspec-mocks', '2.0.1'
gem 'cucumber', '0.9.4'
gem 'will_paginate', '2.3.15'
gem 'ginger', '1.2.0'
gem 'faker', '0.3.1'
end
8 changes: 3 additions & 5 deletions features/support/env.rb
@@ -1,10 +1,8 @@
require 'rubygems'
require 'cucumber'
require 'spec'
require 'fileutils'
require 'ginger'
require 'will_paginate'
require 'active_record'
require 'bundler'

Bundler.require :default, :development

$:.unshift File.dirname(__FILE__) + '/../../lib'
Dir[File.join(File.dirname(__FILE__), '../../vendor/*/lib')].each do |path|
Expand Down
10 changes: 4 additions & 6 deletions spec/spec_helper.rb
Expand Up @@ -5,18 +5,16 @@

require 'rubygems'
require 'fileutils'
require 'ginger'
require 'jeweler'
require 'bundler'

Bundler.require :default, :development

require "#{File.dirname(__FILE__)}/../lib/thinking_sphinx"

require 'will_paginate'

require "#{File.dirname(__FILE__)}/sphinx_helper"

ActiveRecord::Base.logger = Logger.new(StringIO.new)

Spec::Runner.configure do |config|
RSpec.configure do |config|
%w( tmp tmp/config tmp/log tmp/db ).each do |path|
FileUtils.mkdir_p "#{Dir.pwd}/#{path}"
end
Expand Down
Expand Up @@ -63,6 +63,7 @@
it "should add a filter for the attribute in a sphinx scope call" do
Friendship.should_receive(:search).with do |options|
options[:with][:person_id].should == @person.id
Friendship
end

@person.friendships.reverse
Expand Down
2 changes: 2 additions & 0 deletions spec/thinking_sphinx/configuration_spec.rb
Expand Up @@ -118,6 +118,8 @@ module ::Merb; end
config.app_root = "/here/somewhere"
end
ThinkingSphinx::Configuration.instance.app_root.should == "/here/somewhere"

ThinkingSphinx::Configuration.instance.reset
end
end

Expand Down
11 changes: 0 additions & 11 deletions tasks/distribution.rb
Expand Up @@ -29,17 +29,6 @@
"spec/**/*_spec.rb"
]

gem.add_dependency 'activerecord', '>= 1.15.6', '< 3.0.0'
gem.add_dependency 'riddle', '>= 1.0.10'
gem.add_dependency 'after_commit', '>= 1.0.6'

gem.add_development_dependency "yard", ">= 0"
gem.add_development_dependency "rspec", ">= 1.2.9"
gem.add_development_dependency "cucumber", ">= 0"
gem.add_development_dependency "will_paginate", "2.3.11"
gem.add_development_dependency "ginger", "1.2.0"
gem.add_development_dependency "faker", "0.3.1"

gem.post_install_message = <<-MESSAGE
If you're upgrading, you should read this:
http://freelancing-god.github.com/ts/en/upgrading.html
Expand Down
13 changes: 6 additions & 7 deletions tasks/testing.rb
@@ -1,11 +1,11 @@
require 'rubygems'
require 'spec/rake/spectask'
require 'rspec/core/rake_task'
require 'cucumber/rake/task'

desc "Run the specs under spec"
Spec::Rake::SpecTask.new do |t|
t.spec_files = FileList['spec/**/*_spec.rb']
t.spec_opts << "-c"
RSpec::Core::RakeTask.new do |t|
t.pattern = 'spec/**/*_spec.rb'
t.rspec_opts = "-c"
end
task :spec => :check_dependencies

Expand Down Expand Up @@ -33,9 +33,8 @@ def add_task(name, description)
end

desc "Generate RCov reports"
Spec::Rake::SpecTask.new(:rcov) do |t|
t.libs << 'lib'
t.spec_files = FileList['spec/**/*_spec.rb']
RSpec::Core::RakeTask.new(:rcov) do |t|
t.pattern = 'spec/**/*_spec.rb'
t.rcov = true
t.rcov_opts = [
'--exclude', 'spec',
Expand Down

0 comments on commit d7361fb

Please sign in to comment.