spec/unit/spec_helper.rb in blueprints-0.8.2 vs spec/unit/spec_helper.rb in blueprints-0.9.0

- old
+ new

@@ -1,27 +1,19 @@ -#require 'logger' -#require 'active_record' +Root = Pathname.new(__FILE__).dirname.join('..', '..') +$: << Root.join('lib').to_s -Dir.chdir File.join(File.dirname(__FILE__), '..', '..') +require 'rspec' +require 'blueprints' +require File.dirname(__FILE__) + '/fixtures' -#ActiveRecord::Base.logger = Logger.new("debug.log") - -#databases = YAML::load(IO.read("spec/active_record/fixtures/database.yml")) -#db_info = databases[ENV["DB"] || "test"] -#ActiveRecord::Base.establish_connection(db_info) - -require 'spec' -require 'lib/blueprints' - -Spec::Runner.configure do |config| +RSpec.configure do |config| config.mock_with :mocha config.before do - Blueprints::Namespace.root.instance_variable_set(:@context, Blueprints::Context.new) - @mock = Mocha::Mockery.instance.unnamed_mock + Blueprints::Namespace.root.eval_context = Blueprints::EvalContext.new end config.after do - Blueprints::Namespace.root.children.clear + Blueprints::Namespace.root.instance_variable_get(:@children).clear Blueprints::Namespace.root.executed_blueprints.clear end end