diff options
Diffstat (limited to 'spec/mspec')
-rw-r--r-- | spec/mspec/spec/utils/script_spec.rb | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/spec/mspec/spec/utils/script_spec.rb b/spec/mspec/spec/utils/script_spec.rb index 2582809fae..e3188ab5ff 100644 --- a/spec/mspec/spec/utils/script_spec.rb +++ b/spec/mspec/spec/utils/script_spec.rb @@ -350,20 +350,20 @@ describe MSpecScript, "#entries" do before :each do @script = MSpecScript.new - File.stub(:expand_path).and_return("name") + File.stub(:realpath).and_return("name") File.stub(:file?).and_return(false) File.stub(:directory?).and_return(false) end it "returns the pattern in an array if it is a file" do - File.should_receive(:expand_path).with("file").and_return("file/expanded.rb") + File.should_receive(:realpath).with("file").and_return("file/expanded.rb") File.should_receive(:file?).with("file/expanded.rb").and_return(true) @script.entries("file").should == ["file/expanded.rb"] end it "returns Dir['pattern/**/*_spec.rb'] if pattern is a directory" do File.should_receive(:directory?).with("name").and_return(true) - File.stub(:expand_path).and_return("name","name/**/*_spec.rb") + File.stub(:realpath).and_return("name", "name/**/*_spec.rb") Dir.should_receive(:[]).with("name/**/*_spec.rb").and_return(["dir1", "dir2"]) @script.entries("name").should == ["dir1", "dir2"] end @@ -382,13 +382,13 @@ describe MSpecScript, "#entries" do it "returns the pattern in an array if it is a file" do name = "#{@name}.rb" - File.should_receive(:expand_path).with(name).and_return(name) + File.should_receive(:realpath).with(name).and_return(name) File.should_receive(:file?).with(name).and_return(true) @script.entries("name.rb").should == [name] end it "returns Dir['pattern/**/*_spec.rb'] if pattern is a directory" do - File.stub(:expand_path).and_return(@name, @name+"/**/*_spec.rb") + File.stub(:realpath).and_return(@name, @name+"/**/*_spec.rb") File.should_receive(:directory?).with(@name).and_return(true) Dir.should_receive(:[]).with(@name + "/**/*_spec.rb").and_return(["dir1", "dir2"]) @script.entries("name").should == ["dir1", "dir2"] |