Skip to content

Commit

Permalink
trash the bloated Deprecation module that's currently unused
Browse files Browse the repository at this point in the history
  • Loading branch information
mislav committed Aug 6, 2011
1 parent 9d200f9 commit 6e67dcd
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 83 deletions.
50 changes: 0 additions & 50 deletions lib/will_paginate/deprecation.rb

This file was deleted.

30 changes: 0 additions & 30 deletions spec/spec_helper.rb
@@ -1,6 +1,5 @@
require 'rspec'
require File.expand_path('../view_helpers/view_example_group', __FILE__)
require 'will_paginate/deprecation'
begin
require 'ruby-debug'
rescue LoadError
Expand All @@ -21,10 +20,6 @@ def collection(params = {})
end
WillPaginate::Collection.new(params[:page] || 1, params[:per_page] || 30, params[:total_entries])
end

def have_deprecation
DeprecationMatcher.new
end
end

RSpec.configure do |config|
Expand Down Expand Up @@ -54,28 +49,3 @@ def negative_failure_message
"expected #{@actual.inspect} not to contain phrase #{@string.inspect}"
end
end

class DeprecationMatcher
def initialize
@old_behavior = WillPaginate::Deprecation.behavior
@messages = []
WillPaginate::Deprecation.behavior = lambda { |message, callstack|
@messages << message
}
end

def matches?(block)
block.call
!@messages.empty?
ensure
WillPaginate::Deprecation.behavior = @old_behavior
end

def failure_message
"expected block to raise a deprecation warning"
end

def negative_failure_message
"expected block not to raise deprecation warnings, #{@messages.size} raised"
end
end
4 changes: 1 addition & 3 deletions spec/view_helpers/link_renderer_base_spec.rb
Expand Up @@ -21,9 +21,7 @@

it "should have total_pages accessor" do
prepare :total_pages => 42
lambda {
@renderer.send(:total_pages).should == 42
}.should_not have_deprecation
@renderer.send(:total_pages).should == 42
end

it "should clear old cached values when prepared" do
Expand Down

0 comments on commit 6e67dcd

Please sign in to comment.