parent
21ce651984
commit
99b84ea0c9
@ -0,0 +1,24 @@
|
||||
def run_spec(file)
|
||||
unless File.exist?(file)
|
||||
puts "#{file} does not exist"
|
||||
return
|
||||
end
|
||||
|
||||
puts "Running #{file}"
|
||||
system "bundle exec rspec #{file}"
|
||||
puts
|
||||
end
|
||||
|
||||
|
||||
watch("spec/[^/]*/[^/]*_spec\\.rb") do |match|
|
||||
run_spec(match[0])
|
||||
end
|
||||
|
||||
|
||||
watch("app/(.*)\\.rb") do |match|
|
||||
run_spec(%{spec/#{match[1]}_spec.rb})
|
||||
end
|
||||
|
||||
|
||||
|
||||
# vim:filetype=ruby
|
@ -1,2 +1,3 @@
|
||||
class Person < ActiveRecord::Base
|
||||
|
||||
end
|
||||
|
@ -1,5 +1,12 @@
|
||||
require 'spec_helper'
|
||||
|
||||
describe Person do
|
||||
pending "add some examples to (or delete) #{__FILE__}"
|
||||
it "can be instantiated" do
|
||||
Person.new.should be_an_instance_of(Person)
|
||||
end
|
||||
|
||||
it "can be saved successfully" do
|
||||
Person.create.should be_persisted
|
||||
|
||||
end
|
||||
end
|
||||
|
Loading…
Reference in new issue