Module: AllureRSpec::DSL::Example
- Defined in:
- lib/allure-rspec/dsl.rb
Instance Method Summary collapse
Instance Method Details
#attach_file(title, file, opts = {}) ⇒ Object
28 29 30 31 32 33 |
# File 'lib/allure-rspec/dsl.rb', line 28 def attach_file(title, file, opts = {}) suite = [:example_group][:description_args].first.to_s test = [:description].to_s step = current_step AllureRubyAdaptorApi::Builder. suite, test, opts.merge(:title => title, :file => file, :step => step) end |
#current_step ⇒ Object
7 8 9 10 11 12 13 |
# File 'lib/allure-rspec/dsl.rb', line 7 def current_step if defined? @@__current_step @@__current_step else nil end end |
#step(step, &block) ⇒ Object
15 16 17 18 19 20 21 22 23 24 25 26 |
# File 'lib/allure-rspec/dsl.rb', line 15 def step(step, &block) suite = [:example_group][:description_args].first.to_s test = [:description].to_s begin AllureRubyAdaptorApi::Builder.start_step(suite, test, step) __with_step step, &block AllureRubyAdaptorApi::Builder.stop_step(suite, test, step) rescue Exception => e AllureRubyAdaptorApi::Builder.stop_step(suite, test, step, :failed) raise e end end |