Sha256: 37542a4deaaff30ae4aba1bcf5b87c15fb037e6b53611063ecbc8ce147e50d5e

Contents?: true

Size: 1.22 KB

Versions: 2

Compression:

Stored size: 1.22 KB

Contents

ENV.delete 'HTTP_PROXY' if ENV['HTTP_PROXY']
require 'rubygems' #for ruby187
require 'erb'
require 'psych'

begin
	require 'simplexframe'
rescue LoadError
	puts 'you need using "gem install simplexframe" to install simplexframe first'
end

<% require 'active_support/all' %>
Simplexframe::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 :test_case
	c.alias_it_should_behave_like_to :include_shared

	unless($config.tags.empty?)
		tags = case 
			when String
				$config.tags.simple_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
simplexframe-0.0.02 lib/simplexframe/generators/simplexframe/app/cases/spec_helper.rb.tt
simplexframe-0.0.01 lib/simplexframe/generators/simplexframe/app/cases/spec_helper.rb.tt