require 'spec_helper' describe "Formatters::Text" do let (:parsed_file) { ParsedFile.new(class_name: "Foo", complexity: 11) } let (:method_1) { ParsedMethod.new( name: "initialize", complexity: 13, type: "instance" ) } let (:method_2) { ParsedMethod.new( name: "report", complexity: 11, type: "instance" ) } let (:formatter) { Formatters::Html.new(parsed_file) } before do allow(parsed_file).to receive(:methods) { [method_1, method_2] } end describe "#header" do it "returns an HTML-formatted header" do expect(formatter.header).to eq( "