You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
23 lines
454 B
23 lines
454 B
10 years ago
|
require 'minitest/autorun'
|
||
|
|
||
|
require_relative 'alfred'
|
||
|
|
||
|
class TestConfig < Minitest::Test
|
||
|
def setup
|
||
|
@config = Alfred::Config.new('com.kejadlen.test')
|
||
|
end
|
||
|
|
||
|
def teardown
|
||
|
File.delete(@config.path) if File.exist?(@config.path)
|
||
|
end
|
||
|
|
||
|
def test_config
|
||
|
assert_nil @config[:foo]
|
||
|
|
||
|
@config[:foo] = 123
|
||
|
assert_equal 123, @config[:foo]
|
||
|
assert File.exist?(@config.path)
|
||
|
assert_equal '{:foo=>123}', File.read(@config.path)
|
||
|
end
|
||
|
end
|