Class: TestPlugin

Inherits:
Test::Unit::TestCase
  • Object
show all
Defined in:
test/test_plugin/plugin.rb

Instance Method Summary (collapse)

Instance Method Details

- (Object) setup



11
12
13
# File 'test/test_plugin/plugin.rb', line 11

def setup
  @plugin = ODDB::Plugin.new(nil)
end

- (Object) teardown



14
15
16
# File 'test/test_plugin/plugin.rb', line 14

def teardown
  File.delete('/tmp/oddbtest') if File.exist?('/tmp/oddbtest')
end

- (Object) test_http_file



17
18
19
20
21
# File 'test/test_plugin/plugin.rb', line 17

def test_http_file
  assert_equal(nil, @plugin.http_file('www.oddb.org', '/unknown', '/tmp/oddbtest'))
  assert_equal(true, @plugin.http_file('www.google.ch', '/search?q=generika', '/tmp/oddbtest'))
  assert(File.exist?('/tmp/oddbtest'))
end

- (Object) test_log_info



22
23
24
25
26
27
# File 'test/test_plugin/plugin.rb', line 22

def test_log_info
  info = @plugin.log_info
  [:report, :change_flags, :recipients].each { |key|
    assert(info.include?(key))
  }
end