Class: Omnitest::Skeptic::ScenarioDefinition

Inherits:
Core::Dash
  • Object
show all
Defined in:
lib/omnitest/skeptic/scenario_definition.rb

Overview

rubocop:disable ClassLength

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(data) ⇒ ScenarioDefinition

Returns a new instance of ScenarioDefinition.



11
12
13
14
15
# File 'lib/omnitest/skeptic/scenario_definition.rb', line 11

def initialize(data)
  super
  self.vars ||= Skeptic::TestManifest::Environment.new
  @full_name = [suite, name].join(' :: ').freeze
end

Instance Attribute Details

#full_nameObject (readonly)

Returns the value of attribute full_name.



9
10
11
# File 'lib/omnitest/skeptic/scenario_definition.rb', line 9

def full_name
  @full_name
end

Instance Method Details

#build(project) ⇒ Object



17
18
19
20
21
22
23
24
25
26
# File 'lib/omnitest/skeptic/scenario_definition.rb', line 17

def build(project)
  source_file = begin
    file = Core::FileSystem.find_file project.basedir, name
    Core::FileSystem.relativize(file, project.basedir)
  rescue Errno::ENOENT
    nil
  end
  psychic = project.respond_to?(:psychic) ? project.psychic : project
  Scenario.new(psychic: psychic, scenario_definition: self, vars: build_vars, source_file: source_file)
end