fix the tests

This commit is contained in:
John Bintz 2011-11-15 11:23:01 -05:00
parent 203ecb6bf8
commit 432b648d9e
5 changed files with 11 additions and 16 deletions

View File

@ -9,7 +9,7 @@ RSpec::Core::RakeTask.new(:spec)
namespace :spec do namespace :spec do
desc "Run on three Rubies" desc "Run on three Rubies"
task :platforms do task :platforms do
prefix = "rvm 1.8.7,1.9.2,ree ruby" prefix = "rvm 1.8.7,1.9.2,ree,1.9.3 do"
system %{#{prefix} bundle} system %{#{prefix} bundle}
system %{#{prefix} bundle exec rake spec} system %{#{prefix} bundle exec rake spec}
exit $?.exitstatus exit $?.exitstatus

View File

@ -1,10 +1,9 @@
# -*- encoding: utf-8 -*- # -*- encoding: utf-8 -*-
$:.push File.expand_path("../lib", __FILE__) $:.push File.expand_path("../lib", __FILE__)
require "guard-rocco"
Gem::Specification.new do |s| Gem::Specification.new do |s|
s.name = "guard-rocco" s.name = "guard-rocco"
s.version = Guard::Rocco::VERSION s.version = '0.1.0'
s.platform = Gem::Platform::RUBY s.platform = Gem::Platform::RUBY
s.authors = ["John Bintz"] s.authors = ["John Bintz"]
s.email = ["john@coswellproductions.com"] s.email = ["john@coswellproductions.com"]

View File

@ -6,8 +6,6 @@ require 'fileutils'
module Guard module Guard
class Rocco < Guard class Rocco < Guard
autoload :VERSION, 'guard/rocco/version'
def initialize(watchers = [], options = {}) def initialize(watchers = [], options = {})
super super

View File

@ -1,5 +0,0 @@
module Guard
module RoccoVersion
VERSION = '0.1.0'
end
end

View File

@ -14,10 +14,13 @@ describe Guard::Rocco do
FileUtils.rm_rf doc_dir FileUtils.rm_rf doc_dir
end end
let(:guard) { Guard::Rocco.new([], :dir => doc_dir) } let(:guard) { Guard::Rocco.new([], options) }
let(:filename) { 'lib/guard/rocco.rb' } let(:filename) { 'lib/guard/rocco.rb' }
let(:options) { { :dir => doc_dir } }
describe '#run_all' do describe '#run_all' do
let(:options) { { :dir => doc_dir, :run_on => [ :all ] } }
before do before do
guard.stubs(:all_paths).returns([filename]) guard.stubs(:all_paths).returns([filename])
end end
@ -40,14 +43,14 @@ describe Guard::Rocco do
describe 'run options' do describe 'run options' do
it 'should allow array of symbols' do it 'should allow array of symbols' do
guard = Guard::Rocco.new([], :run_on => [:start, :change]) guard = Guard::Rocco.new([], :run_on => [:start, :change])
guard.run_for?(:start).should be_true guard.send(:run_for?, :start).should be_true
guard.run_for?(:reload).should be_false guard.send(:run_for?, :reload).should be_false
end end
it 'should allow symbol' do it 'should allow symbol' do
guard = Guard::RailsAssets.new([], :run_on => :start) guard = Guard::Rocco.new([], :run_on => :start)
guard.run_for?(:start).should be_true guard.send(:run_for?, :start).should be_true
guard.run_for?(:reload).should be_false guard.send(:run_for?, :reload).should be_false
end end
end end
end end