From 62ebc08d52ca844c1f7d0db302d6fafed355e346 Mon Sep 17 00:00:00 2001 From: Kyrylo Silin Date: Sat, 23 Nov 2013 22:13:54 +0200 Subject: [PATCH] spec/code_spec.rb: add more tests for $LOAD_PATH behaviour --- spec/code_spec.rb | 8 ++++++++ spec/fixtures/cat_load_path | 0 spec/fixtures/cat_load_path.rb | 0 3 files changed, 8 insertions(+) create mode 100644 spec/fixtures/cat_load_path create mode 100644 spec/fixtures/cat_load_path.rb diff --git a/spec/code_spec.rb b/spec/code_spec.rb index 3f06e808..51b626f6 100644 --- a/spec/code_spec.rb +++ b/spec/code_spec.rb @@ -71,6 +71,14 @@ describe Pry::Code do it 'finds files in a relative directory with `.rb` omitted' do Pry::Code.from_file('../helper').code_type.should == :ruby end + + it "doesn't confuse files with the same name, but without an extension" do + Pry::Code.from_file('cat_load_path').code_type.should == :unknown + end + + it "doesn't confuse files with the same name, but with an extension" do + Pry::Code.from_file('cat_load_path.rb').code_type.should == :ruby + end end end diff --git a/spec/fixtures/cat_load_path b/spec/fixtures/cat_load_path new file mode 100644 index 00000000..e69de29b diff --git a/spec/fixtures/cat_load_path.rb b/spec/fixtures/cat_load_path.rb new file mode 100644 index 00000000..e69de29b