# frozen_string_literal: true
require 'yaml'
require 'singleton'
require 'pry'
module Plugin
module Rules
class RulesLoader
include Singleton
attr_reader :definitions
def initialize
@definitions = load #it is calling the private method and loads the definitions
end
def fetch_rule_definition_for(key)
definitions[key]
end
private
def load
#Other code
Hash = {}
#this method returns the hash after processing
end
end
end
end
How to write specs for this class where the initialize method calls the private method and loads the instance variable. As the load method is private i am not calling directly.