Skip to content

Commit

Permalink
Merge pull request #3 from ericmathison/fix-failing-test
Browse files Browse the repository at this point in the history
Use ENV['HOME'] instead of hardcoding home dir
  • Loading branch information
leejones committed Sep 12, 2013
2 parents 4e2aba5 + 94bf33d commit 95ba58f
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions spec/trash_spec.rb
Expand Up @@ -55,28 +55,28 @@ def tmp_should_not_contain(file_name)
Trash.new.throw_out("/tmp/testing.txt")
tmp_should_not_contain "testing.txt"
trash_should_contain "testing.txt"
original = File.new("/Users/leejones/.Trash/testing.txt", "r")
original = File.new("#{ENV['HOME']}/.Trash/testing.txt", "r")
original.read.should == "default text\n"

`echo 'testing different file with same name' > /tmp/testing.txt`
Trash.new.throw_out("/tmp/testing.txt")
tmp_should_not_contain "testing.txt"
trash_should_contain "testing01.txt"
third = File.new("/Users/leejones/.Trash/testing01.txt", "r")
third = File.new("#{ENV['HOME']}/.Trash/testing01.txt", "r")
third.read.should == "testing different file with same name\n"

`echo 'testing different file 2 with same name' > /tmp/testing.txt`
Trash.new.throw_out("/tmp/testing.txt")
tmp_should_not_contain "testing.txt"
trash_should_contain "testing02.txt"
fourth = File.new("/Users/leejones/.Trash/testing02.txt", "r")
fourth = File.new("#{ENV['HOME']}/.Trash/testing02.txt", "r")
fourth.read.should == "testing different file 2 with same name\n"

`echo 'testing different file 3 with same name' > /tmp/testing.txt`
Trash.new.throw_out("/tmp/testing.txt")
tmp_should_not_contain "testing.txt"
trash_should_contain "testing03.txt"
fifth = File.new("/Users/leejones/.Trash/testing03.txt", "r")
fifth = File.new("#{ENV['HOME']}/.Trash/testing03.txt", "r")
fifth.read.should == "testing different file 3 with same name\n"

delete_from_trash "testing.txt"
Expand Down

0 comments on commit 95ba58f

Please sign in to comment.