2008-06-18 00:55:11 +00:00
|
|
|
require 'rubygems'
|
|
|
|
require 'rake'
|
|
|
|
require 'spec/rake/spectask'
|
|
|
|
|
2008-06-18 00:57:06 +00:00
|
|
|
task :default => [:spec, :test]
|
2008-06-18 00:55:11 +00:00
|
|
|
|
|
|
|
Spec::Rake::SpecTask.new("spec") do |t|
|
|
|
|
t.spec_files = FileList['spec/**/*_spec.rb']
|
|
|
|
t.spec_opts = ['--color']
|
|
|
|
end
|
2008-06-18 00:57:06 +00:00
|
|
|
|
2008-06-18 01:12:15 +00:00
|
|
|
Spec::Rake::SpecTask.new("rcov_spec") do |t|
|
|
|
|
t.spec_files = FileList['spec/**/*_spec.rb']
|
|
|
|
t.spec_opts = ['--color']
|
|
|
|
t.rcov = true
|
|
|
|
t.rcov_opts = ['--exclude', '^spec,/gems/']
|
|
|
|
end
|
|
|
|
|
2008-06-18 00:57:06 +00:00
|
|
|
task :test do
|
2008-06-18 01:13:48 +00:00
|
|
|
sh 'make', '-C', File.dirname(__FILE__) + "/../../test/rb"
|
|
|
|
end
|
|
|
|
|
|
|
|
task :'gen-rb' do
|
|
|
|
thrift = '../../compiler/cpp/thrift'
|
|
|
|
dir = File.dirname(__FILE__) + '/spec'
|
|
|
|
sh thrift, '--gen', 'rb', '-o', dir, "#{dir}/ThriftSpec.thrift"
|
2008-06-18 00:57:06 +00:00
|
|
|
end
|