Skip to content
Browse files

declare development dependencies

  • Loading branch information...
1 parent 81601e4 commit 8b6146e075d006ecddb26a07fab9253653a5147d @bkeepers bkeepers committed Dec 19, 2009
Showing with 13 additions and 13 deletions.
  1. +4 −0 Rakefile
  2. +1 −1 spec/delayed_method_spec.rb
  3. +1 −2 spec/job_spec.rb
  4. +5 −7 spec/{database.rb → spec_helper.rb}
  5. +1 −1 spec/story_spec.rb
  6. +1 −2 spec/worker_spec.rb
View
4 Rakefile
@@ -19,6 +19,9 @@ Jeweler::Tasks.new do |s|
s.extra_rdoc_files = ["README.textile"]
s.test_files = Dir['spec/**/*']
+
+ s.add_development_dependency "rspec"
+ s.add_development_dependency "sqlite3-ruby"
end
require 'spec/rake/spectask'
@@ -31,4 +34,5 @@ Spec::Rake::SpecTask.new(:spec) do |t|
t.pattern = 'spec/**/*_spec.rb'
t.verbose = true
end
+task :spec => :check_dependencies
View
2 spec/delayed_method_spec.rb
@@ -1,4 +1,4 @@
-require File.dirname(__FILE__) + '/database'
+require 'spec_helper'
class SimpleJob
cattr_accessor :runs; self.runs = 0
View
3 spec/job_spec.rb
@@ -1,5 +1,4 @@
-require File.dirname(__FILE__) + '/database'
-require File.dirname(__FILE__) + '/sample_jobs'
+require 'spec_helper'
describe Delayed::Job do
before do
View
12 spec/database.rb → spec/spec_helper.rb
@@ -1,15 +1,12 @@
$:.unshift(File.dirname(__FILE__) + '/../lib')
-$:.unshift(File.dirname(__FILE__) + '/../../rspec/lib')
require 'rubygems'
-require 'active_record'
-gem 'sqlite3-ruby'
-
-require File.dirname(__FILE__) + '/../init'
require 'spec'
+require 'active_record'
+require 'delayed_job'
ActiveRecord::Base.logger = Logger.new('/tmp/dj.log')
-ActiveRecord::Base.establish_connection(:adapter => 'sqlite3', :database => '/tmp/jobs.sqlite')
+ActiveRecord::Base.establish_connection(:adapter => 'sqlite3', :database => ':memory:')
ActiveRecord::Migration.verbose = false
ActiveRecord::Schema.define do
@@ -32,11 +29,12 @@
end
-
# Purely useful for test cases...
class Story < ActiveRecord::Base
def tell; text; end
def whatever(n, _); tell*n; end
handle_asynchronously :whatever
end
+
+require 'sample_jobs'
View
2 spec/story_spec.rb
@@ -1,4 +1,4 @@
-require File.dirname(__FILE__) + '/database'
+require 'spec_helper'
describe "A story" do
View
3 spec/worker_spec.rb
@@ -1,5 +1,4 @@
-require File.dirname(__FILE__) + '/database'
-require File.dirname(__FILE__) + '/sample_jobs'
+require 'spec_helper'
describe Delayed::Worker do
def job_create(opts = {})

0 comments on commit 8b6146e

Please sign in to comment.
Something went wrong with that request. Please try again.