Sha256: e1a7537425c1bee80a871762e280a5a6a4ff6a83391c02249c2d6073faa1a5ea

Contents?: true

Size: 624 Bytes

Versions: 2

Compression:

Stored size: 624 Bytes

Contents

require 'spec_helper'
require 'fixtures/foo_model'

describe MarkAsRead::Readable do

  describe '#mark_as_read' do
    it 'should store the proc' do
      proc = lambda { puts "Hello world" }
      FooModel.class_eval do
        mark_as_read(&proc)
      end

      FooModel.mark_as_read_proc.should == proc
    end
  end

  describe '#mark_as_read!' do
    it 'should call the proc' do
      proc = lambda { puts "Hello world" }
      FooModel.class_eval do
        mark_as_read(&proc)
      end

      instance = FooModel.new
      proc.should_receive(:call).with(instance)
      instance.mark_as_read!
    end
  end

end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
mark_as_read-0.0.2 spec/models/readable_spec.rb
mark_as_read-0.0.1 spec/models/readable_spec.rb