RSpec double/mock print method from call
问题 My method prints in the console a list of viewed TV Shows. I want to test call method which trigger private print_result method: def initialize(parser) @parser = parser @views_hash = parser.page_views end def call puts "\n" puts 'LIST OF MOST POPULAR TV SHOWS' print_results(sort_all) puts "\n\n" end private def print_results(sorted_hash) puts "\n" puts "#{'TV Show'.center(20)} | VIEWS" puts '---------------------+----------' sorted_hash.each do |page, views_no| puts "#{page.ljust(20)} | #