jcfischer / make_resourceful

Hampton Catlins and Nex3's make_resourceful plugin

This URL has Read+Write access

make_resourceful / spec / base_spec.rb
100644 13 lines (10 sloc) 0.555 kb
1
2
3
4
5
6
7
8
9
10
11
12
13
require File.dirname(__FILE__) + '/spec_helper'
 
describe Resourceful::Base, ".made_resourceful" do
  before(:all) { @original_blocks = Resourceful::Base.made_resourceful.dup }
  before(:each) { Resourceful::Base.made_resourceful.replace [] }
  after(:all) { Resourceful::Base.made_resourceful.replace @original_blocks }
 
  it "should store blocks when called with blocks and return them when called without a block" do
    5.times { Resourceful::Base.made_resourceful(&should_be_called) }
    Resourceful::Base.made_resourceful.each(&:call)
  end
end