Class: Belly::Messages::CucumberScenarioResultMessage

Inherits:
Object
  • Object
show all
Defined in:
lib/belly/messages/cucumber_scenario_result_message.rb

Instance Method Summary collapse

Constructor Details

#initialize(feature_name, scenario, user, project_name, feature_file, line) ⇒ CucumberScenarioResultMessage

Returns a new instance of CucumberScenarioResultMessage.



4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
# File 'lib/belly/messages/cucumber_scenario_result_message.rb', line 4

def initialize(feature_name, scenario, user, project_name, feature_file, line)
  @data = {
    :type => self.class.name,
    :id => {
      :feature => feature_name,
      :scenario => scenario.name,
      :feature_file => feature_file,
      :line => line
    },
    :exception => {
      :message => scenario.exception.to_s
    },
    :status => scenario.status,
    :user => user,
    :project => project_name
  }
end

Instance Method Details

#to_jsonObject



22
23
24
# File 'lib/belly/messages/cucumber_scenario_result_message.rb', line 22

def to_json
  @data.to_json
end