# # Author:: Salim Afiune ( {}, "before" => {}, "delta" => "", "duration" => "", "id" => "hyrule", "ignore_failure" => false, "name" => "hyrule", "result" => "create", "status" => "unprocessed", "type" => :zelda, } end it "returns a hash containing the expected values" do expect(report.to_hash).to eq hash end end context "for a lazy_resource that got skipped" do let(:resource) do klass = Class.new(Chef::Resource) do resource_name "link" property :sword, String, name_property: true, identity: true end resource = klass.new("hyrule") resource.sword = Chef::DelayedEvaluator.new { nil } resource end let(:hash) do { "after" => {}, "before" => {}, "delta" => "", "duration" => "", "conditional" => "because", "id" => "unknown identity (due to Chef::Exceptions::ValidationFailed)", "ignore_failure" => false, "name" => "hyrule", "result" => "create", "status" => "skipped", "type" => :link, } end let(:conditional) do double("Chef::Resource::Conditional", :to_text => "because") end it "should handle any Exception and throw a helpful message by mocking the identity" do report.skipped(conditional) expect(report.to_hash).to eq hash end end end end