Sha256: d609ab2c85553a0e5c69906012bb17de98c09cb9f224b13bb4f21e0850c425d4
Contents?: true
Size: 827 Bytes
Versions: 11
Compression:
Stored size: 827 Bytes
Contents
require File.join(File.dirname(__FILE__), '..', '..', '/test_helper') module Garb Exits = Class.new class FakeProfile include ProfileReports end class ProfileReportsTest < MiniTest::Unit::TestCase context "The ProfileReports module" do should "define a new method when given a class" do ProfileReports.add_report_method(Exits) assert_equal true, FakeProfile.new.respond_to?(:exits) end should "return results from the given class with options" do results = [1,2,3] Exits.stubs(:results).returns(results) ProfileReports.add_report_method(Exits) profile = FakeProfile.new assert_equal results, profile.exits(:start => "now") assert_received(Exits, :results) {|e| e.with(profile, :start => "now")} end end end end
Version data entries
11 entries across 11 versions & 4 rubygems