spec/lib/soloist/spotlight_spec.rb in soloist-1.0.0.pre vs spec/lib/soloist/spotlight_spec.rb in soloist-1.0.0

- old
+ new

@@ -1,10 +1,9 @@ require "spec_helper" describe Soloist::Spotlight do - let(:tempdir) { Dir.mktmpdir } - let(:shallow_path) { File.expand_path("beans/roger", tempdir) } + let(:shallow_path) { File.expand_path("beans/roger", RSpec.configuration.tempdir) } let(:spotlight) { Soloist::Spotlight.new(shallow_path) } before { FileUtils.mkdir_p(shallow_path) } describe "#find" do @@ -47,10 +46,10 @@ let(:file_path) { File.expand_path("soloistrc", shallow_path) } before { FileUtils.touch(file_path) } it "finds a soloistrc in the current directory" do - spotlight.find("soloistrc").to_s.should == tempdir + "/beans/roger/soloistrc" + spotlight.find("soloistrc").to_s.should =~ /\/beans\/roger\/soloistrc$/ end context "inside a deeper directory" do let(:deep_path) { File.expand_path("meat/hi", shallow_path) } let(:spotlight) { Soloist::Spotlight.new(deep_path) }