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

Instance Method Summary collapse

Methods included from DescribesItself

#describe_to

Methods included from HasLocation

#attributes, #file, #file_colon_line, #line, #match_locations?, #multiline_arg

Methods included from Names

#inspect, #legacy_conflated_name_and_description, #name, #to_s

Constructor Details

#initialize(gherkin_statement, language, location, background, comments, tags, feature_tags, keyword, title, description, raw_steps) ⇒ Scenario

Returns a new instance of Scenario.



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

def initialize(gherkin_statement, language, location, background, comments, tags, feature_tags, keyword, title, description, raw_steps)
  @gherkin_statement = gherkin_statement
  @language          = language
  @location          = location
  @background        = background
  @comments          = comments
  @tags              = tags
  @feature_tags      = feature_tags
  @keyword           = keyword
  @title             = title
  @description       = description
  @raw_steps         = raw_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

#feature_tagsObject (readonly)

Returns the value of attribute feature_tags.



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

def feature_tags
  @feature_tags
end

#gherkin_statementObject (readonly)

Returns the value of attribute gherkin_statement.



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

def gherkin_statement
  @gherkin_statement
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

#languageObject (readonly)

Returns the value of attribute language.



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

def language
  @language
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

#titleObject (readonly)

Returns the value of attribute title.



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

def title
  @title
end

Instance Method Details

#childrenObject



33
34
35
# File 'lib/cucumber/core/ast/scenario.rb', line 33

def children
  raw_steps
end

#to_sexpObject



37
38
39
40
41
42
43
44
45
# File 'lib/cucumber/core/ast/scenario.rb', line 37

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