/vendor/daemon_kit/lib/daemon_kit/cucumber/world.rb

http://github.com/mperham/qanat · Ruby · 38 lines · 24 code · 7 blank · 7 comment · 1 complexity · 6488b5036be20295896a9cd6a3f4565f MD5 · raw file

  1. # -*- coding: utf-8 -*-
  2. # Based on code from Brian Takita, Yurii Rashkovskii, Ben Mabey and Aslak Hellesøy
  3. # Adapted by Kenneth Kalmer for daemon-kit
  4. begin
  5. require 'test/unit/testresult'
  6. rescue LoadError => e
  7. e.message << "\nYou must gem install test-unit. For more info see https://rspec.lighthouseapp.com/projects/16211/tickets/292"
  8. raise e
  9. end
  10. # So that Test::Unit doesn't launch at the end - makes it think it has already been run.
  11. Test::Unit.run = true if Test::Unit.respond_to?(:run=)
  12. $__cucumber_toplevel = self
  13. module DaemonKit
  14. module Cucumber
  15. # All scenarios will execute in the context of a new instance of World.
  16. class World
  17. def initialize #:nodoc:
  18. @_result = Test::Unit::TestResult.new
  19. end
  20. end
  21. $__cucumber_toplevel.Before do
  22. # Placeholder
  23. end
  24. $__cucumber_toplevel.After do
  25. # Placeholder
  26. end
  27. end
  28. end
  29. World do
  30. DaemonKit::Cucumber::World.new
  31. end