1
0
Fork 0
mirror of https://github.com/pry/pry.git synced 2022-11-09 12:35:05 -05:00
pry--pry/spec/warning_spec.rb
Kyrylo Silin 473bc9f2d6 Add Pry::Warning
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.
2019-05-04 17:42:02 +03:00

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