Skip to content

Commit

Permalink
test on ships
Browse files Browse the repository at this point in the history
  • Loading branch information
Gerhard Koekemoer committed Nov 16, 2011
1 parent 3a4352b commit a96f2ca
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 1 deletion.
22 changes: 22 additions & 0 deletions Guardfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# A sample Guardfile
# More info at https://github.com/guard/guard#readme

guard 'rspec', :version => 2 do
watch(%r{^spec/.+_spec\.rb$})
watch(%r{^lib/(.+)\.rb$}) { |m| "spec/lib/#{m[1]}_spec.rb" }
watch('spec/spec_helper.rb') { "spec" }

# Rails example
watch(%r{^spec/.+_spec\.rb$})
watch(%r{^app/(.+)\.rb$}) { |m| "spec/#{m[1]}_spec.rb" }
watch(%r{^app/(.*)(\.erb|\.haml)$}) { |m| "spec/#{m[1]}#{m[2]}_spec.rb" }
watch(%r{^lib/(.+)\.rb$}) { |m| "spec/lib/#{m[1]}_spec.rb" }
watch(%r{^app/controllers/(.+)_(controller)\.rb$}) { |m| ["spec/routing/#{m[1]}_routing_spec.rb", "spec/#{m[2]}s/#{m[1]}_#{m[2]}_spec.rb", "spec/acceptance/#{m[1]}_spec.rb"] }
watch(%r{^spec/support/(.+)\.rb$}) { "spec" }
watch('spec/spec_helper.rb') { "spec" }
watch('config/routes.rb') { "spec/routing" }
watch('app/controllers/application_controller.rb') { "spec/controllers" }
# Capybara request specs
watch(%r{^app/views/(.+)/.*\.(erb|haml)$}) { |m| "spec/requests/#{m[1]}_spec.rb" }
end

5 changes: 5 additions & 0 deletions spec/factories.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
Factory.define(:ship) do |f|
f.name "Carrier"
f.length 5

end
6 changes: 5 additions & 1 deletion spec/models/ship_spec.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
require 'spec_helper'

describe Ship do
pending "add some examples to (or delete) #{__FILE__}"
context "Validations" do
it "should create ship instance given valid attributes" do
lambda { Factory.create(:ship) }.should change(Ship, :count).by(1)
end
end
end

0 comments on commit a96f2ca

Please sign in to comment.