Skip to content

Commit

Permalink
Fix tests under unix.
Browse files Browse the repository at this point in the history
  • Loading branch information
jarmo committed Feb 21, 2014
1 parent 0685f60 commit 59ba1a3
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 3 deletions.
10 changes: 9 additions & 1 deletion lib/duplicati.rb
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,15 @@ def execution_success?
private

def duplicati_path(path_from_options)
path_from_options || ENV["DUPLICATI_PATH"] || (ENV["OS"] == "Windows_NT" ? "/Program Files/Duplicati/Duplicati.CommandLine" : "duplicati-commandline")
path_from_options || ENV["DUPLICATI_PATH"] || (windows? ? "/Program Files/Duplicati/#{duplicati_executable_name}" : duplicati_executable_name)
end

def duplicati_executable_name
windows? ? "Duplicati.CommandLine" : "duplicati-commandline"
end

def windows?
ENV["OS"] == "Windows_NT"
end

def execute(command)
Expand Down
2 changes: 1 addition & 1 deletion lib/duplicati/version.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
class Duplicati
VERSION = "2.0.0"
VERSION = "2.0.1"
end
3 changes: 2 additions & 1 deletion spec/duplicati_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@
end

it "has default duplicati path" do
File.basename(Duplicati.new.opts[:duplicati_path]).should == "Duplicati.CommandLine"
duplicati = Duplicati.new
File.basename(duplicati.opts[:duplicati_path]).should == duplicati.send(:duplicati_executable_name)
end

it "allows to specify duplicati path via options" do
Expand Down

0 comments on commit 59ba1a3

Please sign in to comment.