summaryrefslogtreecommitdiff
path: root/spec/mspec/spec/utils/deprecate_spec.rb
blob: 14e05c6f3526dbc3abfb29681447437927d2cb5d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
require 'spec_helper'
require 'mspec/utils/deprecate'

describe MSpec, "#deprecate" do
  it "warns when using a deprecated method" do
    warning = nil
    $stderr.stub(:puts) { |str| warning = str }
    MSpec.deprecate(:some_method, :other_method)
    warning.should start_with(<<-EOS.chomp)

some_method is deprecated, use other_method instead.
from 
EOS
    warning.should include(__FILE__)
    warning.should include('8')
  end
end