# encoding: utf-8 # author: Steven Danna require 'helper' require 'inspec/control_eval_context' describe Inspec::ControlEvalContext do module FakeDSL def foobar "wombat" end end let(:control_content) { <"}) eval_context.instance_eval(control_content) profile_context.all_rules.each do |rule| # Turn each rule into an example group and run it, none of the # example content should raise an exception Inspec::Rule.prepare_checks(rule).each do |m, a, b| # if we require this at the top level, none of the other tests # in this file will run. itsfine.jpg require 'rspec/core' RSpec::Core::ExampleGroup.describe(*a, &b).run end end end describe "#resource" do let(:resource_dsl) { Inspec::Resource.create_dsl(profile_context) } let(:inner_context) { Inspec::ProfileContext.new('inner-context', backend, {}) } let(:control_content) do < mock(:new => 'newfoo')}) eval_context.instance_eval(control_content).must_equal "newfoo" end end end