Skip to content

Commit

Permalink
Updated watchr to run functional tests
Browse files Browse the repository at this point in the history
  • Loading branch information
arafatm committed Aug 4, 2010
1 parent 31375c9 commit 13dc5ac
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 0 deletions.
18 changes: 18 additions & 0 deletions spec/functional/plan_spec.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
require File.dirname(__FILE__) + '/../spec_helper'
require 'rack/test'

include Rack::Test::Methods

def app
Sinatra::Application
end

describe 'Planner' do
before do
DataMapper::Model.descendants.each {|m| m.all.destroy!}
end

it 'should return true in the test' do
true.should.be.true
end
end
8 changes: 8 additions & 0 deletions spec/spec.watchr
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,18 @@ def run_model_spec(spec)
run_spec("spec/models/#{spec}_spec.rb")
end

def run_functional_spec(spec)
run_spec("spec/functional/#{spec}_spec.rb")
end

# models
watch('^spec/models/.*_spec\.rb') {|md| run_spec(md[0]) }
watch('^lib/models/(.*)\.rb') {|md| run_model_spec(md[1]) }

# functionals
watch('^spec/functional/.*_spec\.rb') {|md| run_spec(md[0]) }
watch('^lib/(.*)\.rb') {|md| run_functional_spec(md[1]) }

#watch('^app/(.*)\.rb') {|md| run_spec("spec/#{md[1]}_spec.rb") }
#watch('^app/(.*\.haml)') {|md| run_spec("spec/#{md[1]}_spec.rb") }

Expand Down

0 comments on commit 13dc5ac

Please sign in to comment.