Sha256: d4af3921c794fc65df661355db2d3464e71f19e89edd26761fc220914403bb7b

Contents?: true

Size: 1.55 KB

Versions: 5

Compression:

Stored size: 1.55 KB

Contents

# Test cases for test_plugin_helper.rb
require File.expand_path('../test_helper', __FILE__)
require File.expand_path('../test_plugin_helper', __FILE__)

class TestPluginTestHelper < Test::Unit::TestCase
	include TDiary::PluginTestHelper

	def test_absolute_path_of
		abspath = File.expand_path(File.join(File.dirname(__FILE__), '..', 'plugin', '00default.rb'))
		assert_equal(abspath, TDiary::PluginTestHelper.absolute_path_of('plugin/00default.rb'))
	end

	def test_resource_absolute_path_of
		abspath = File.expand_path(File.join(File.dirname(__FILE__), '..', 'plugin', 'en', '00default.rb'))
		assert_equal(abspath, TDiary::PluginTestHelper.resource_absolute_path_of('plugin/00default.rb', 'en'))
	end

	def test_resource_relative_path_of
		abspath = File.join('plugin', 'en', '00default.rb')
		assert_equal(abspath, TDiary::PluginTestHelper.resource_relative_path_of('plugin/00default.rb', 'en'))
	end

	def test_new_plugin
		assert_nothing_raised do
			TDiary::StubPlugin::new_plugin('plugin/00default.rb', 'en')
		end
	end

	def test_load_plugin
		assert_nothing_raised do
			TDiary::StubPlugin::load_plugin('plugin/00default.rb', 'en')
		end
	end

	def test_plugin_conf
		plugin = TDiary::StubPlugin::load_plugin('plugin/00default.rb', 'en')
		assert_nothing_raised do
			plugin.conf['key'] = 'value'
		end
		assert_equal('value', plugin.conf['key'])
	end

	def test_plugin_options
		plugin = TDiary::StubPlugin::load_plugin('plugin/00default.rb', 'en')
		assert_nothing_raised do
			plugin.options['key'] = 'value'
		end
		assert_equal('value', plugin.options['key'])
	end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
tdiary-4.0.5.1 test/test_plugin_helper_test.rb
tdiary-4.0.5 test/test_plugin_helper_test.rb
tdiary-4.0.4 test/test_plugin_helper_test.rb
tdiary-4.0.3 test/test_plugin_helper_test.rb
tdiary-4.0.2.20140201 test/test_plugin_helper_test.rb