Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

rspec 2.0 support

  • Loading branch information...
commit 97a304cc1fb8ea65424ac20fa44d7b1c5b098c11 1 parent 2499205
@flyerhzm authored
View
1  .gitignore
@@ -3,3 +3,4 @@ pkg/**
.DS_Store
lib/.DS_Store
.*.swp
+coverage.data
View
1  .rspec
@@ -0,0 +1 @@
+--colour --format d
View
47 Rakefile
@@ -15,20 +15,37 @@ Rake::RDocTask.new(:rdoc) do |rdoc|
rdoc.rdoc_files.include('lib/**/*.rb')
end
-# FIXME: 'rake spec' will break the test, just run 'ruby spec/association_spec.rb'
-#desc "Run all specs in spec directory"
-#Rspec::Core::RakeTask.new(:spec) do |t|
- #t.pattern = FileList['spec/**/*_spec.rb']
-#end
+RSpec::Core::RakeTask.new(:spec)
-Jeweler::Tasks.new do |gemspec|
- gemspec.name = "bullet"
- gemspec.summary = "A plugin to kill N+1 queries and unused eager loading"
- gemspec.description = "The Bullet plugin is designed to help you increase your application's performance by reducing the number of queries it makes. It will watch your queries while you develop your application and notify you when you should add eager loading (N+1 queries) or when you're using eager loading that isn't necessary."
- gemspec.email = "flyerhzm@gmail.com"
- gemspec.homepage = "http://github.com/flyerhzm/bullet"
- gemspec.authors = ["Richard Huang"]
- gemspec.files.exclude '.gitignore'
- gemspec.files.exclude 'log/*'
+desc "Run all examples using rcov"
+RSpec::Core::RakeTask.new :rcov => :cleanup_rcov_files do |t|
+ t.rcov = true
+ t.rcov_opts = %[-Ilib -Ispec --exclude "gems/*,spec/spec_helper.rb"]
+ t.rcov_opts << %[--no-html --aggregate coverage.data]
+end
+
+task :cleanup_rcov_files do
+ rm_rf 'coverage.data'
+end
+
+task :clobber do
+ rm_rf 'pkg'
+ rm_rf 'tmp'
+ rm_rf 'coverage'
+end
+
+begin
+ Jeweler::Tasks.new do |gemspec|
+ gemspec.name = "bullet"
+ gemspec.summary = "A rails plugin to kill N+1 queries and unused eager loading"
+ gemspec.description = "The Bullet plugin is designed to help you increase your application's performance by reducing the number of queries it makes. It will watch your queries while you develop your application and notify you when you should add eager loading (N+1 queries) or when you're using eager loading that isn't necessary."
+ gemspec.email = "flyerhzm@gmail.com"
+ gemspec.homepage = "http://github.com/flyerhzm/bullet"
+ gemspec.authors = ["Richard Huang"]
+ gemspec.files.exclude '.gitignore'
+ gemspec.files.exclude 'log/*'
+ end
+ Jeweler::GemcutterTasks.new
+rescue LoadError
+ puts "Jeweler (or a dependency) not available. Install it with: gem install jeweler"
end
-Jeweler::GemcutterTasks.new
View
1  autotest/discover.rb
@@ -0,0 +1 @@
+Autotest.add_discovery { "rspec2" }
View
4 spec/spec_helper.rb
@@ -1,6 +1,6 @@
require 'rubygems'
-require 'spec'
-# require 'rspec/autorun'
+require 'rspec'
+require 'rspec/autorun'
require 'rails'
require 'active_record'
require 'action_controller'
Please sign in to comment.
Something went wrong with that request. Please try again.