| Kevin Clark | 5a7103a | 2008-06-18 00:55:11 +0000 | [diff] [blame] | 1 | require 'rubygems' | 
 | 2 | require 'rake' | 
 | 3 | require 'spec/rake/spectask' | 
 | 4 |  | 
| Kevin Clark | c2a07b1 | 2008-06-18 00:57:06 +0000 | [diff] [blame] | 5 | task :default => [:spec, :test] | 
| Kevin Clark | 5a7103a | 2008-06-18 00:55:11 +0000 | [diff] [blame] | 6 |  | 
 | 7 | Spec::Rake::SpecTask.new("spec") do |t| | 
 | 8 |   t.spec_files = FileList['spec/**/*_spec.rb'] | 
 | 9 |   t.spec_opts = ['--color'] | 
 | 10 | end | 
| Kevin Clark | c2a07b1 | 2008-06-18 00:57:06 +0000 | [diff] [blame] | 11 |  | 
| Kevin Clark | eb0dd7f | 2008-06-18 01:12:15 +0000 | [diff] [blame] | 12 | Spec::Rake::SpecTask.new("rcov_spec") do |t| | 
 | 13 |   t.spec_files = FileList['spec/**/*_spec.rb'] | 
 | 14 |   t.spec_opts = ['--color'] | 
 | 15 |   t.rcov = true | 
 | 16 |   t.rcov_opts = ['--exclude', '^spec,/gems/'] | 
 | 17 | end | 
 | 18 |  | 
| Kevin Clark | c2a07b1 | 2008-06-18 00:57:06 +0000 | [diff] [blame] | 19 | task :test do | 
| Kevin Clark | a7613dd | 2008-06-18 01:13:48 +0000 | [diff] [blame] | 20 |   sh 'make', '-C', File.dirname(__FILE__) + "/../../test/rb" | 
 | 21 | end | 
 | 22 |  | 
 | 23 | task :'gen-rb' do | 
 | 24 |   thrift = '../../compiler/cpp/thrift' | 
 | 25 |   dir = File.dirname(__FILE__) + '/spec' | 
 | 26 |   sh thrift, '--gen', 'rb', '-o', dir, "#{dir}/ThriftSpec.thrift" | 
| Kevin Clark | c2a07b1 | 2008-06-18 00:57:06 +0000 | [diff] [blame] | 27 | end |