summaryrefslogtreecommitdiff
path: root/spec/warning_spec.rb
diff options
context:
space:
mode:
Diffstat (limited to 'spec/warning_spec.rb')
-rw-r--r--spec/warning_spec.rb10
1 files changed, 10 insertions, 0 deletions
diff --git a/spec/warning_spec.rb b/spec/warning_spec.rb
new file mode 100644
index 00000000..3f7328ce
--- /dev/null
+++ b/spec/warning_spec.rb
@@ -0,0 +1,10 @@
+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