Module: Nonnative::Cucumber

Defined in:
lib/nonnative/cucumber.rb

Overview

Lazily installs the Cucumber integration once the Cucumber Ruby DSL is ready.

Requiring ‘nonnative` outside a running Cucumber environment should not fail, but when Cucumber does finish booting its support-code registry this installer still needs to register the hooks and step definitions defined here.

Defined Under Namespace

Modules: Assertions, LanguageHook, LifecycleSteps, ProxySteps, Registration, WorldHooks

Class Method Summary collapse

Class Method Details

.bootstrap!Object



194
195
196
197
198
199
200
201
202
# File 'lib/nonnative/cucumber.rb', line 194

def bootstrap!
  return if @bootstrapped

  dsl_singleton = ::Cucumber::Glue::Dsl.singleton_class
  dsl_singleton.prepend(LanguageHook) unless dsl_singleton.ancestors.include?(LanguageHook)

  @bootstrapped = true
  install!
end

.install!Object



204
205
206
207
208
209
210
# File 'lib/nonnative/cucumber.rb', line 204

def install!
  return if @installed
  return unless ready?

  Registration.install!
  @installed = true
end