Class: ConcordionParseResult

Inherits:
Object
  • Object
show all
Includes:
ConcordionUtility
Defined in:
lib/concordion_parse_result.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from ConcordionUtility

#concordion_arguments, #concordion_cmd_attr_exists?, #concordion_cmd_attr_for, #concordion_property_reference, #concordion_variable_name, #has_property_reference?, #instrumentation, #supported_and_instrumented?

Methods included from ConcordionConvenience

#methods_for

Methods included from ConcordionStringUtility

#attr_writer_method?, #concordion_assignment, #concordion_method_name, #ends_in_empty_parens?, #escape_single_quotes, #has_arguments?, #has_assignment?, #is_direct_method_call?

Methods included from PluralToSingularUtility

#singular

Methods included from SnakeCaseUtility

#snake_case, #snake_cased_goldmaster_name, #snake_cased_test_name

Methods included from ConcordionConstants

#concordion_command_attributes, #supported?

Constructor Details

#initialize(cmd, sut, content, tag) ⇒ ConcordionParseResult

Returns a new instance of ConcordionParseResult.



6
7
8
9
10
11
# File 'lib/concordion_parse_result.rb', line 6

def initialize(cmd, sut, content, tag)
  @concordion_command = cmd
  @system_under_test = sut
  @content = content
  @tag = tag
end

Instance Attribute Details

#concordion_commandObject

Returns the value of attribute concordion_command.



5
6
7
# File 'lib/concordion_parse_result.rb', line 5

def concordion_command
  @concordion_command
end

#contentObject

Returns the value of attribute content.



5
6
7
# File 'lib/concordion_parse_result.rb', line 5

def content
  @content
end

#system_under_testObject

Returns the value of attribute system_under_test.



5
6
7
# File 'lib/concordion_parse_result.rb', line 5

def system_under_test
  @system_under_test
end

#tagObject

Returns the value of attribute tag.



5
6
7
# File 'lib/concordion_parse_result.rb', line 5

def tag
  @tag
end

Instance Method Details

#assignmentObject



42
43
44
# File 'lib/concordion_parse_result.rb', line 42

def assignment
  concordion_assignment(@system_under_test)
end

#image_locationObject



37
38
39
40
# File 'lib/concordion_parse_result.rb', line 37

def image_location
  return nil if @tag.nil?
  @tag.get_attribute('src')
end

#is_assert_image_command?Boolean

Returns:

  • (Boolean)


16
17
18
# File 'lib/concordion_parse_result.rb', line 16

def is_assert_image_command?
  "assert_image" == @concordion_command
end

#is_assert_true_command?Boolean

Returns:

  • (Boolean)


29
30
31
# File 'lib/concordion_parse_result.rb', line 29

def is_assert_true_command?
  "asserttrue" == @concordion_command
end

#is_execute_command?Boolean

Returns:

  • (Boolean)


26
27
28
# File 'lib/concordion_parse_result.rb', line 26

def is_execute_command?
  "execute" == @concordion_command
end

#is_set_command?Boolean

Returns:

  • (Boolean)


20
21
22
# File 'lib/concordion_parse_result.rb', line 20

def is_set_command?
  "set" == @concordion_command
end

#is_verify_command?Boolean

Returns:

  • (Boolean)


23
24
25
# File 'lib/concordion_parse_result.rb', line 23

def is_verify_command?
  "verifyrows" == @concordion_command
end

#needs_dereference?Boolean

Returns:

  • (Boolean)


46
47
48
# File 'lib/concordion_parse_result.rb', line 46

def needs_dereference?
  @system_under_test =~ /^#/ && @system_under_test.index("=").nil?
end

#num_results_expectedObject



33
34
35
# File 'lib/concordion_parse_result.rb', line 33

def num_results_expected
  @tag.search("tr").size - 1
end

#to_sObject



12
13
14
# File 'lib/concordion_parse_result.rb', line 12

def to_s
  "Concordion command[#{@concordion_command}], System under test method[#{@system_under_test}], Tag Content[#{@content}] Image Location[#{image_location}]"
end