Class: TestPatinfo

Inherits:
Test::Unit::TestCase
  • Object
show all
Includes:
FlexMock::TestCase
Defined in:
test/test_model/patinfo.rb

Defined Under Namespace

Classes: StubSequence

Instance Method Summary (collapse)

Instance Method Details

- (Object) setup



31
32
33
# File 'test/test_model/patinfo.rb', line 31

def setup
  @patinfo = ODDB::Patinfo.new
end

- (Object) test_add_sequence



34
35
36
37
38
39
# File 'test/test_model/patinfo.rb', line 34

def test_add_sequence
  @patinfo.sequences = []
  prod = StubSequence.new
  @patinfo.add_sequence(prod)
  assert_equal([prod], @patinfo.sequences)
end

- (Object) test_company_name



40
41
42
43
44
# File 'test/test_model/patinfo.rb', line 40

def test_company_name
  assert_nil @patinfo.company_name
  @patinfo.sequences.push flexmock(:company_name => 'Company Name')
  assert_equal 'Company Name', @patinfo.company_name
end

- (Object) test_name_base



45
46
47
48
49
# File 'test/test_model/patinfo.rb', line 45

def test_name_base
  assert_nil @patinfo.name_base
  @patinfo.sequences.push flexmock(:name_base => 'Company Name')
  assert_equal 'Company Name', @patinfo.name_base
end

- (Object) test_remove_sequence



50
51
52
53
54
55
# File 'test/test_model/patinfo.rb', line 50

def test_remove_sequence
  prod = StubSequence.new
  @patinfo.sequences = [prod]
  @patinfo.remove_sequence(prod)
  assert_equal([],@patinfo.sequences)
end