Class: RSpec::Lono::Harness

Inherits:
Object
  • Object
show all
Defined in:
lib/rspec/lono/harness.rb,
lib/rspec/lono/harness/project.rb

Defined Under Namespace

Classes: Project

Instance Method Summary collapse

Constructor Details

#initialize(options = {}) ⇒ Harness

Returns a new instance of Harness.



3
4
5
# File 'lib/rspec/lono/harness.rb', line 3

def initialize(options={})
  @options = options
end

Instance Method Details

#build(options = {}) ⇒ Object



7
8
9
10
11
12
# File 'lib/rspec/lono/harness.rb', line 7

def build(options={})
  setup
  project = Project.new(@options.merge(options))
  root = project.create
  Lono.root = root # switch root to the generated test harness
end

#setupObject



14
15
16
17
18
19
20
# File 'lib/rspec/lono/harness.rb', line 14

def setup
  # Require gems in Gemfile so lono_plugin_* gets loaded and registered
  # This it test Gemfile. IE: app/stacks/demo/test/Gemfile
  Kernel.require "bundler/setup"
  Bundler.require # Same as Bundler.require(:default)
  Lono.check_project = false
end