# File lib/librarian/rspec/support/cli_macro.rb, line 28 def initialize(rel_path, content, options = { }) self.rel_path = rel_path self.content = content self.type = options[:type] end
# File lib/librarian/rspec/support/cli_macro.rb, line 36 def actual_content @actual_content ||= begin s = full_path.read s = JSON.parse(s) if type == :json s end end
# File lib/librarian/rspec/support/cli_macro.rb, line 33 def full_path @full_path ||= base_path + rel_path end
# File lib/librarian/rspec/support/cli_macro.rb, line 43 def matches?(base_path) base_path = Pathname(base_path) unless Pathname === base_path self.base_path = base_path full_path.file? && (!content || actual_content == content) end