Sha256: db1504e4b9510c7f5fe1e9e42c45409f10807b54ecce5b0396663fe74b41246d

Contents?: true

Size: 823 Bytes

Versions: 2

Compression:

Stored size: 823 Bytes

Contents

require 'rubygems' #for ruby187
require 'erb'
require 'psych'

begin
	require 'lazyman'
rescue LoadError
	puts 'you need using "gem install lazyman" to install lazyman first'
end
<% require 'active_support/all' %>
Lazyman::Initializer.new(File.expand_path(File.join('.')), '<%= app_name %>')
$:.unshift(File.expand_path File.join('.'))

RSpec.configure do |c|

	def test_data file
		content = ''
		file_path = File.expand_path(File.join('.', 'app', 'test_data', "#{file}.yml"))
		raise "Can not find #{file}.yml" unless File.exists?(file_path)
		File.open(file_path, 'r') do |handle|
			content = handle.read
		end
		Psych.load ERB.new(content).result(binding)
	end
	
	c.before(:all) do
		$navi = <%= app_name.camelize %>Navigator.new $config
	end

	c.after(:all) do
		$navi.close
	end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
lazyman-0.1.4 lib/lazyman/generators/lazyman/app/cases/spec_helper.rb.tt
lazyman-0.1.3 lib/lazyman/generators/lazyman/app/cases/spec_helper.rb.tt