Sha256: ed9cfa7ab98d45da0ae93473f63a5210f483f0e7460b7da474a0cd9d2ca2dc06

Contents?: true

Size: 1.2 KB

Versions: 2

Compression:

Stored size: 1.2 KB

Contents

ENV.delete 'HTTP_PROXY' if ENV['HTTP_PROXY']
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|
	c.treat_symbols_as_metadata_keys_with_true_values = true
	c.run_all_when_everything_filtered = true
	c.alias_example_to :case
	c.alias_it_should_behave_like_to :include_shared

	unless($config.tags.empty?)
		tags = case 
			when String
				$config.tags.lazy_to_hash
			when Hash
				$config.tags
			end #case
		c.filter_run tags
	end 

	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(:suite) do
		$navi = <%= app_name.camelize %>Navigator.new $config
	end

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

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
lazyman-0.1.7 lib/lazyman/generators/lazyman/app/cases/spec_helper.rb.tt
lazyman-0.1.6 lib/lazyman/generators/lazyman/app/cases/spec_helper.rb.tt