Class: Cucumber::Core::Ast::Scenario

Inherits:
Object
  • Object
show all
Includes:
DescribesItself, HasLocation, Names
Defined in:
lib/cucumber/core/ast/scenario.rb

Instance Attribute Summary collapse

Attributes included from Names

#name

Instance Method Summary collapse

Methods included from DescribesItself

#describe_to

Methods included from HasLocation

#all_locations, #attributes, #file, #file_colon_line, #line, #multiline_arg

Methods included from Names

#inspect, #legacy_conflated_name_and_description, #to_s

Constructor Details

#initialize(location, comments, tags, keyword, name, description, steps) ⇒ Scenario

Returns a new instance of Scenario.



19
20
21
22
23
24
25
26
27
# File 'lib/cucumber/core/ast/scenario.rb', line 19

def initialize(location, comments, tags, keyword, name, description, steps)
  @location          = location
  @comments          = comments
  @tags              = tags
  @keyword           = keyword
  @name              = name
  @description       = description
  @raw_steps         = steps
end

Instance Attribute Details

#backgroundObject (readonly)

Returns the value of attribute background.



14
15
16
# File 'lib/cucumber/core/ast/scenario.rb', line 14

def background
  @background
end

#commentsObject (readonly)

Returns the value of attribute comments.



14
15
16
# File 'lib/cucumber/core/ast/scenario.rb', line 14

def comments
  @comments
end

#descriptionObject (readonly)

Returns the value of attribute description.



14
15
16
# File 'lib/cucumber/core/ast/scenario.rb', line 14

def description
  @description
end

#keywordObject (readonly)

Returns the value of attribute keyword.



14
15
16
# File 'lib/cucumber/core/ast/scenario.rb', line 14

def keyword
  @keyword
end

#locationObject (readonly)

Returns the value of attribute location.



14
15
16
# File 'lib/cucumber/core/ast/scenario.rb', line 14

def location
  @location
end

#tagsObject (readonly)

Returns the value of attribute tags.



14
15
16
# File 'lib/cucumber/core/ast/scenario.rb', line 14

def tags
  @tags
end

Instance Method Details

#childrenObject



29
30
31
# File 'lib/cucumber/core/ast/scenario.rb', line 29

def children
  raw_steps
end

#to_sexpObject



33
34
35
36
37
38
39
40
41
# File 'lib/cucumber/core/ast/scenario.rb', line 33

def to_sexp
  sexp = [:scenario, line, keyword, name]
  comment = comment.to_sexp
  sexp += [comment] if comment
  tags = tags.to_sexp
  sexp += tags if tags.any?
  sexp += step_invocations.to_sexp if step_invocations.any?
  sexp
end