From 76c5d0e85025161d46bf115637604c3e28bb9f6d Mon Sep 17 00:00:00 2001 From: John Bintz Date: Mon, 6 Jun 2011 09:49:37 -0400 Subject: [PATCH] more changes and testing stuff --- .travis.yml | 5 +++++ Gemfile | 2 +- README.md | 1 + Rakefile | 9 +++++++-- lib/guard/jasmine-headless-webkit.rb | 1 - 5 files changed, 14 insertions(+), 4 deletions(-) create mode 100644 .travis.yml diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 0000000..f00c4cb --- /dev/null +++ b/.travis.yml @@ -0,0 +1,5 @@ +rvm: + - 1.8.7 + - 1.9.2 + - ree +script: "bundle exec spec" diff --git a/Gemfile b/Gemfile index 4156a87..9cdbbed 100644 --- a/Gemfile +++ b/Gemfile @@ -2,7 +2,7 @@ source "http://rubygems.org" # Specify your gem's dependencies in guard-jasmine-headless-webkit.gemspec gemspec -gem 'guard' +gem 'guard', :git => 'https://github.com/guard/guard.git' gem 'rspec' gem 'mocha' gem 'rake', '0.8.7' diff --git a/README.md b/README.md index edfb7f2..badeab5 100644 --- a/README.md +++ b/README.md @@ -17,6 +17,7 @@ home folder's `.jasmine-headless-webkit` file. * `:all_on_start => false` to not run everything when starting, just like `guard-rspec`. * `:run_before => "` to run a command before running specs. If the command fails, the test run stops. * `:jammit => true` to run `jammit -f 2>/dev/null` before the tests for the current file change are run. +* `:valid_extensions => %w{` to run `jammit -f 2>/dev/null` before the tests for the current file change are run. ## What's the deal with `newest_js_file`? diff --git a/Rakefile b/Rakefile index 3d78d95..88f2272 100644 --- a/Rakefile +++ b/Rakefile @@ -7,6 +7,10 @@ task :push_everywhere do system %{git push guard master} end +require 'rspec/core/rake_task' + +RSpec::Core::RakeTask.new(:spec) + namespace :spec do desc "Run on three Rubies" task :platforms do @@ -15,8 +19,9 @@ namespace :spec do fail = false %w{1.8.7 1.9.2 ree}.each do |version| puts "Switching to #{version}" - system %{rvm #{version}} - system %{bundle exec rspec spec} + Bundler.with_clean_env do + system %{bash -c 'source ~/.rvm/scripts/rvm && rvm #{version} && bundle exec rake spec'} + end if $?.exitstatus != 0 fail = true break diff --git a/lib/guard/jasmine-headless-webkit.rb b/lib/guard/jasmine-headless-webkit.rb index 5c5b848..704219c 100644 --- a/lib/guard/jasmine-headless-webkit.rb +++ b/lib/guard/jasmine-headless-webkit.rb @@ -73,7 +73,6 @@ module Guard class Dsl def newest_js_file(path) - p binding Dir[path + '*.{js,coffee}'].sort { |left, right| File.mtime(right) <=> File.mtime(left) }.first end end