File: package_test.rb

package info (click to toggle)
ruby-zoom 0.4.1-5
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 264 kB
  • sloc: ansic: 680; xml: 262; ruby: 254; makefile: 2
file content (41 lines) | stat: -rw-r--r-- 1,211 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
class TestPackage < Test::Unit::TestCase

  def setup
    @connection = ZOOM::Connection.new
  end

  def test_connection_package
      assert(@connection.respond_to?('package'))
      p = @connection.package
      assert_equal(p.class.to_s, 'ZOOM::Package')
  end

  def test_option_returns_same_value
      p = @connection.package
      p.action = 'update'
      assert_equal('update', p.action)
  end

  def test_options_containing_hyphen
    # option contact-name
      p = @connection.package
      assert(p.respond_to?('contact_name'))
      assert(p.respond_to?('contact_name='))
      assert(p.respond_to?('set_contact_name'))

      p.contact_name = 'contact_name value'
      assert_equal('contact_name value', p.contact_name)
  end

  def test_option_containing_fullstop
    #option correlationInfo.note
      p = @connection.package
      assert(p.respond_to?('correlation_info_note'))
      assert(p.respond_to?('correlation_info_note='))
      assert_equal(true, p.respond_to?('set_correlation_info_note'))

      p.correlation_info_note = 'correlation_info_note value'
      assert_equal('correlation_info_note value', p.correlation_info_note)
  end

end