test/test_rbst.rb in RbST-0.1.0 vs test/test_rbst.rb in RbST-0.1.1

- old
+ new

@@ -1,21 +1,22 @@ -require File.join(File.dirname(__FILE__), 'test_helper') +require 'test_helper' require 'mocha' class TestRbST < Test::Unit::TestCase def setup [:rst, :html, :latex].each do |f| instance_variable_set( :"@#{f}_file", 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 should "convert ReST to html" do html = RbST.new(@rst_file).to_html @@ -28,10 +29,10 @@ end [: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 should "recognize strip_comments option" do