producer-core/spec/spec_helper.rb
Thibault Jouan fcba1a5c0b Implement rspec TestEnvHelpers:
Allow use of our test environment, with a mocked remote and convenient
methods to write more concise expectations.

  #env, builds and returns a memoized test environment (with mocked
  remote)

  #output, returns env output as a string

  #remote_fs, returns env remote fs

  #expect_execution, setup a remote command execution expectation
2014-03-04 23:24:05 +00:00

16 lines
339 B
Ruby

require 'producer/core'
Dir['spec/support/**/*.rb'].map { |e| require e.gsub 'spec/', '' }
RSpec.configure do |c|
c.treat_symbols_as_metadata_keys_with_true_values = true
c.include TestEnvHelpers, :env
c.include NetSSHStoryHelpers, :ssh
c.before(:each, :ssh) do
allow(Net::SSH).to receive(:start) { connection }
end
end