<commit_before>require 'cheffish/chef_run'

module Cheffish
  module RSpec
    class RecipeRunWrapper < ChefRun
      def initialize(chef_config, &recipe)
        super(chef_config)
        @recipe = recipe
      end

      attr_reader :recipe

      def client
        if !@client
          super
          @client.load_block(&recipe)
        end
        @client
      end
    end
  end
end<commit_msg>Call methods on the example (such as let) if no recipe method is found<commit_after>require 'cheffish/chef_run'

module Cheffish
  module RSpec
    class RecipeRunWrapper < ChefRun
      def initialize(chef_config, &recipe)
        super(chef_config)
        @recipe = recipe
      end

      attr_reader :recipe

      def client
        if !@client
          super
          example = recipe.binding.eval('self')
          @client.load_block(&recipe)
          @client.define_singleton_method(:method_missing) do |name, *args, &block|
            example.public_send(name, *args, &block)
          end
        end
        @client
      end
    end
  end
end
{'fraction_non_alphanumeric': 0.07062146892655367, 'fraction_numerical': 0.0, 'mean_word_length': 2.0545977011494254, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7236090', 'n_tokens_mistral': 327, 'n_tokens_neox': 320, 'n_words': 83}