Skip to content

Commit

Permalink
expanding executable path
Browse files Browse the repository at this point in the history
  • Loading branch information
xwmx committed Dec 3, 2009
1 parent d5b3eba commit bc21a30
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion lib/rbst.rb
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ def print_options(format)
private

def self.executable(writer = :html)
File.join(File.dirname(__FILE__), "rst2parts", "rst2#{writer}.py")
File.expand_path(File.join(File.dirname(__FILE__), "rst2parts", "rst2#{writer}.py"))
end

def execute(command)
Expand Down
5 changes: 3 additions & 2 deletions test/test_rbst.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,12 @@ def setup
File.join(File.dirname(__FILE__), 'files', "test.#{f}")
)
end
@rst2parts_path = File.expand_path(File.join(File.dirname(__FILE__), '..', 'lib', 'rst2parts'))
end

should "call bare rest2parts when passed no options" do
converter = RbST.new(@rst_file)
converter.expects(:execute).with('python ./test/../lib/rst2parts/rst2html.py').returns(true)
converter.expects(:execute).with("python #{@rst2parts_path}/rst2html.py").returns(true)
assert converter.convert
end

Expand All @@ -30,7 +31,7 @@ def setup
[:html, :latex].each do |f|
should "accept options on #to_#{f}" do
converter = RbST.new(@rst_file)
converter.expects(:execute).with("python ./test/../lib/rst2parts/rst2#{f}.py --raw-enabled").returns(true)
converter.expects(:execute).with("python #{@rst2parts_path}/rst2#{f}.py --raw-enabled").returns(true)
assert converter.send("to_#{f}", :raw_enabled)
end
end
Expand Down

0 comments on commit bc21a30

Please sign in to comment.