summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorpseudomuto <david.muto@gmail.com>2013-12-18 15:49:32 -0500
committerpseudomuto <david.muto@gmail.com>2013-12-18 15:49:32 -0500
commit69ed82efa8319e7fbde9df95a4fad4ee96aa5074 (patch)
tree965568b45fa1485bcc6b7c19e1ec4ec93813e2c0 /test
parent4a042c5cfef6d29d509af12830d11304578fa6aa (diff)
adding haml to dev dependencies so all tests run
Diffstat (limited to 'test')
-rw-r--r--test/app_test.rb37
-rw-r--r--test/test_helper.rb3
2 files changed, 18 insertions, 22 deletions
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, '<h1>haml</h1>'
- 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, '<h1>haml</h1>'
end
- rescue LoadError
- puts "[skipping haml tests because haml isn't installed]"
end
def test_get_nonexistent_dashboard
diff --git a/test/test_helper.rb b/test/test_helper.rb
index d2337c5..b4bbd9e 100644
--- a/test/test_helper.rb
+++ b/test/test_helper.rb
@@ -2,6 +2,7 @@ require 'rack/test'
require 'stringio'
require 'test/unit'
require 'tmpdir'
+require_relative '../lib/dashing'
ENV['RACK_ENV'] = 'test'
WORKING_DIRECTORY = Dir.pwd.freeze
@@ -31,4 +32,4 @@ module Dashing
class Test < Test::Unit::TestCase
include Rack::Test::Methods
end
-end \ No newline at end of file
+end