Permalink
Browse files

add rake-compiler tasks to build and run the specs

  • Loading branch information...
1 parent 7d7898b commit c079b708afc66f7852f5bcf879ff949ef008d131 @igrigorik committed Mar 27, 2011
Showing with 12 additions and 2 deletions.
  1. +10 −1 Rakefile
  2. +1 −0 libsnappy.gemspec
  3. +1 −1 spec/snappy_spec.rb
View
@@ -2,8 +2,17 @@ require 'bundler'
Bundler::GemHelper.install_tasks
require 'rspec/core/rake_task'
+require 'rake/extensiontask'
+
+Rake::ExtensionTask.new do |ext|
+ ext.name = 'libsnappy'
+ ext.ext_dir = 'ext'
+ ext.lib_dir = 'lib'
+ ext.config_script = 'extconf.rb'
+end
desc "Run all RSpec tests"
RSpec::Core::RakeTask.new(:spec)
-task :default => :spec
+desc "Build libsnappy, then run tests."
+task :default => [:compile, :spec]
View
@@ -14,6 +14,7 @@ Gem::Specification.new do |s|
s.rubyforge_project = "libsnappy"
s.extensions = ["ext/extconf.rb"]
+ s.add_development_dependency "rake-compiler", "0.7.6"
s.add_development_dependency "rspec"
s.files = `git ls-files`.split("\n")
View
@@ -1,5 +1,5 @@
require 'rspec'
-require 'snappy'
+require 'libsnappy'
describe Snappy do
it 'should compress data' do

0 comments on commit c079b70

Please sign in to comment.