11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
|
# File 'lib/executable_stories/rspec.rb', line 11
def story(scenario, tags: nil, ticket: nil, meta: nil, trace_url_template: nil, **example_metadata, &block)
it(scenario, **example_metadata, executable_stories: {
scenario: scenario,
tags: tags,
ticket: ticket,
meta: meta,
trace_url_template: trace_url_template
}) do
story = ExecutableStories.init(
scenario,
tags: tags,
ticket: ticket,
meta: meta,
trace_url_template: trace_url_template
)
story.meta ||= {}
story.meta["rspec"] = {
"fullDescription" => RSpec.current_example.full_description,
"description" => RSpec.current_example.description,
"filePath" => RSpec.current_example.metadata[:file_path],
"lineNumber" => RSpec.current_example.metadata[:line_number],
"scopedId" => RSpec.current_example.metadata[:scoped_id]
}
RSpec.current_example.metadata[:executable_stories_story] = story
instance_exec(story, &block) if block
end
end
|