summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLamont Granquist <lamont@scriptkiddie.org>2014-01-12 17:41:47 -0800
committerLamont Granquist <lamont@scriptkiddie.org>2014-01-12 17:41:47 -0800
commitd7a94948a6e5719c876fa261cfd17a4b78d722e7 (patch)
treeb453c408e1486c4e863dfedbcc5b3d0b1ddb5c38
parent7484ea0e1b43a8b786ce61dd2952bcc691a39345 (diff)
downloadffi-yajl-d7a94948a6e5719c876fa261cfd17a4b78d722e7.tar.gz
make "rake spec" run ffi+ext on platforms that support both
-rw-r--r--README.md3
-rw-r--r--Rakefile22
2 files changed, 21 insertions, 4 deletions
diff --git a/README.md b/README.md
index 07521cd..9c89033 100644
--- a/README.md
+++ b/README.md
@@ -3,7 +3,8 @@
## TODO
-- test both ffi and ext on platforms that support both (MRI, rbx)
+- fix int conversion issue in chef specs in c extension
+- fix c extension on rubinius
## BUILD NOTES
diff --git a/Rakefile b/Rakefile
index 122d470..50ca1b8 100644
--- a/Rakefile
+++ b/Rakefile
@@ -9,9 +9,25 @@ end
require 'ffi_yajl/version'
-desc "Run all specs in spec directory"
-RSpec::Core::RakeTask.new(:spec) do |t|
- t.pattern = FileList['spec/**/*_spec.rb']
+desc "Run all specs against both extensions"
+task :spec do
+ Rake::Task["spec:ffi"].invoke
+ Rake::Task["spec:ext"].invoke
+end
+
+namespace :spec do
+ desc "Run all specs against ffi extension"
+ RSpec::Core::RakeTask.new(:ffi) do |t|
+ ENV['FORCE_FFI_YAJL'] = "ffi"
+ t.pattern = FileList['spec/**/*_spec.rb']
+ end
+ if RUBY_VERSION.to_f >= 1.9 && RUBY_ENGINE !~ /jruby/
+ desc "Run all specs again c extension"
+ RSpec::Core::RakeTask.new(:ext) do |t|
+ ENV['FORCE_FFI_YAJL'] = "ext"
+ t.pattern = FileList['spec/**/*_spec.rb']
+ end
+ end
end
desc "Build it and ship it"