Sha256: 2ffb4e8b57cd3ab9c8fa230136f97b5befc0c507345bb90cc093884cd7ed526f
Contents?: true
Size: 600 Bytes
Versions: 1
Compression:
Stored size: 600 Bytes
Contents
require File.dirname(__FILE__) + '/../spec_helper' PROC = proc { author.reverse } class BlockAkismetModel include Rakismet::Model rakismet_attrs :author => PROC end describe BlockAkismetModel do before do @block = BlockAkismetModel.new comment_attrs.each_pair { |k,v| @block.stub!(k).and_return(v) } end it "should accept a block" do BlockAkismetModel.akismet_attrs[:comment_author].should eql(PROC) end it "should eval block with self = instance" do data = @block.send(:akismet_data) data[:comment_author].should eql(comment_attrs[:author].reverse) end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
rakismet-1.2.1 | spec/models/block_params_spec.rb |