mirror of
https://github.com/pry/pry.git
synced 2022-11-09 12:35:05 -05:00
473bc9f2d6
Quite often, when we deprecate APIs, we want to print a warning. Such a warning would be hard to track without a file and line location. We are trying to be a good citizen and print warnings like Ruby does it.
10 lines
266 B
Ruby
10 lines
266 B
Ruby
RSpec.describe Pry::Warning do
|
|
describe "#warn" do
|
|
it "prints a warning with file and line" do
|
|
expect(Kernel).to receive(:warn).with(
|
|
"#{__FILE__}:#{__LINE__ + 2}: warning: foo bar"
|
|
)
|
|
described_class.warn('foo bar')
|
|
end
|
|
end
|
|
end
|