Skip to content

Commit

Permalink
dev not equals test
Browse files Browse the repository at this point in the history
  • Loading branch information
guilhermesilveira committed Jun 11, 2010
1 parent fd88c57 commit e6cadaa
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions Rakefile
Expand Up @@ -66,14 +66,15 @@ def kill_server
end

def wait_server
15.times do
(1..15).each do
begin
Net::HTTP.get(URI.parse('http://localhost:3000/'))
return
rescue
sleep 1
end
end
raise "Waited for the server but it did not finish"
end

desc 'Start server'
Expand Down Expand Up @@ -132,6 +133,7 @@ namespace :test do
start_server_and_invoke_test('test:spec:all')
puts "Execution integration tests... (task test:integration)"
Rake::Task["test:integration"].invoke()
Rake::Task["test:examples"].invoke()
end
task :common do
start_server_and_invoke_test('test:spec:common')
Expand All @@ -151,10 +153,8 @@ namespace :test do
task :examples do
kill_server
enter_dir = "cd full-examples/rest_from_scratch/part_3"
system "#{enter_dir} && RAILS_ENV=test rake db:reset db:seed"
system "#{enter_dir} && RAILS_ENV=test script/server &"
system "#{enter_dir} && rake db:reset db:seed && script/server -d"
wait_server
system "sleep 5 && curl http://localhost:3000/items"
system "#{enter_dir} && rake spec"
kill_server
end
Expand Down
2 changes: 1 addition & 1 deletion full-examples/rest_from_scratch/part_3/db/schema.rb
Expand Up @@ -9,7 +9,7 @@
#
# It's strongly recommended to check this file into your version control system.

ActiveRecord::Schema.define(:version => 20100610230044) do
ActiveRecord::Schema.define(:version => 20100421000609) do

create_table "baskets", :force => true do |t|
t.datetime "created_at"
Expand Down

0 comments on commit e6cadaa

Please sign in to comment.