require File.dirname(__FILE__) + '/test_helper' class SessionTest < Test::Unit::TestCase def setup @session = Session.new(%w(one.astrovan.local), :user => 'admin') super end def test_should_initialize_hosts assert_equal %w(one.astrovan.local), @session.hosts end def test_hosts_should_be_readonly assert_raise(NoMethodError) { @session.hosts = %w(two.astrovan.local) } end def test_should_fail_for_undefined_value assert_raise(NoMethodError) { @session.unknown } end def test_should_initialize_value assert_equal 'admin', @session.user end def test_should_set_value @session.password = 'Passw0rd' assert_equal 'Passw0rd', @session.password end def test_should_overwrite_value @session.user = 'marc.garneau' assert_equal 'marc.garneau', @session.user end def test_should_have_predefined_methods_to_run_standard_rake_tasks assert_method :migrate, @session assert_method :enable, @session assert_method :disable, @session end end