Sha256: e0161f7b582a61485b057d789859dcc36de8b6baaaaae5f6d4ae9ee12f077c30
Contents?: true
Size: 541 Bytes
Versions: 14
Compression:
Stored size: 541 Bytes
Contents
require 'spec_helper' require File.expand_path('../../../config/initializers/active_record_extensions', __FILE__) describe "ActiveRecord::Base", :active_record => true do describe "#safe_send" do it "only calls #read_attribute once" do @player = Player.new @player.number = 23 original_method = @player.method(:read_attribute) @player.should_receive(:read_attribute).exactly(1).times do |*args| original_method.call(*args) end expect(@player.safe_send(:number)).to eq(23) end end end
Version data entries
14 entries across 14 versions & 2 rubygems