require File.dirname(__FILE__) + '/spec_helper'

describe Resourceful::Base, ".made_resourceful" do
  before(:each) { Resourceful::Base.made_resourceful.replace [] }

  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

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

Fix a nasty test bug that caused the integration tests to fail under ill-defined circumstances.
Fix a nasty test bug that caused the integration tests to fail under ill-defined circumstances.

git-svn-id: 30fef0787527f3d4b2d3639a5d6955e4dc84682e@160 c18eca5a-f828-0410-9317-b2e082e89db6
