From 69ed82efa8319e7fbde9df95a4fad4ee96aa5074 Mon Sep 17 00:00:00 2001 From: pseudomuto Date: Wed, 18 Dec 2013 15:49:32 -0500 Subject: adding haml to dev dependencies so all tests run --- test/app_test.rb | 37 ++++++++++++++++--------------------- 1 file changed, 16 insertions(+), 21 deletions(-) (limited to 'test/app_test.rb') diff --git a/test/app_test.rb b/test/app_test.rb index 0032165..0547eb8 100644 --- a/test/app_test.rb +++ b/test/app_test.rb @@ -1,5 +1,6 @@ require 'test_helper' -require File.expand_path('../../lib/dashing', __FILE__) +require 'haml' + Sinatra::Application.settings.history_file = File.join(Dir.tmpdir, 'history.yml') class AppTest < Dashing::Test @@ -94,29 +95,23 @@ class AppTest < Dashing::Test end end - begin - require 'haml' - - def test_get_haml_dashboard - with_generated_project do |dir| - File.write(File.join(dir, 'dashboards/hamltest.haml'), '.gridster') - get '/hamltest' - assert_equal 200, last_response.status - assert_include last_response.body, "class='gridster'" - end + def test_get_haml_dashboard + with_generated_project do |dir| + File.write(File.join(dir, 'dashboards/hamltest.haml'), '.gridster') + get '/hamltest' + assert_equal 200, last_response.status + assert_include last_response.body, "class='gridster'" end + end - def test_get_haml_widget - with_generated_project do |dir| - File.write(File.join(dir, 'widgets/clock/clock.haml'), '%h1 haml') - File.unlink(File.join(dir, 'widgets/clock/clock.html')) - get '/views/clock.html' - assert_equal 200, last_response.status - assert_include last_response.body, '

haml

' - end + def test_get_haml_widget + with_generated_project do |dir| + File.write(File.join(dir, 'widgets/clock/clock.haml'), '%h1 haml') + File.unlink(File.join(dir, 'widgets/clock/clock.html')) + get '/views/clock.html' + assert_equal 200, last_response.status + assert_include last_response.body, '

haml

' end - rescue LoadError - puts "[skipping haml tests because haml isn't installed]" end def test_get_nonexistent_dashboard -- cgit v1.2.3