missed in previous, only affects tests

This commit is contained in:
jasper 2015-12-07 08:04:21 +00:00
parent 4ec2ee27c0
commit 11324b60a4

View File

@ -0,0 +1,111 @@
$OpenBSD: patch-spec_compiler_tt_compiler_spec_rb,v 1.1 2015/12/07 08:04:21 jasper Exp $
--- spec/compiler/tt_compiler_spec.rb.orig Mon Dec 7 09:00:00 2015
+++ spec/compiler/tt_compiler_spec.rb Mon Dec 7 09:00:39 2015
@@ -34,7 +34,7 @@ describe "The 'tt' comand line compiler" do
it 'can compile a grammar file' do
# puts %q{emulate 'tt dumb.tt'}
- system("ruby -S tt #{@test_grammar}").should be_truthy
+ system("${RUBY} -S tt #{@test_grammar}").should be_truthy
File.exists?(@test_ruby).should be_truthy
File.zero?(@test_ruby).should_not be_truthy
@@ -52,7 +52,7 @@ describe "The 'tt' comand line compiler" do
it 'can compile an absolute pathed grammar file' do
# puts %q{emulate 'tt "/path/to/dumb.tt"'}
- system("ruby -S tt \"#{File.expand_path(@test_grammar)}\"").should be_truthy
+ system("${RUBY} -S tt \"#{File.expand_path(@test_grammar)}\"").should be_truthy
File.exists?(@test_ruby).should be_truthy
File.zero?(@test_ruby).should_not be_truthy
@@ -60,7 +60,7 @@ describe "The 'tt' comand line compiler" do
it 'can compile without explicit file extensions' do
# puts %q{emulate 'tt dumb'}
- system("ruby -S tt #{@test_path}").should be_truthy
+ system("${RUBY} -S tt #{@test_path}").should be_truthy
File.exists?(@test_ruby).should be_truthy
File.zero?(@test_ruby).should_not be_truthy
@@ -79,7 +79,7 @@ describe "The 'tt' comand line compiler" do
# puts %q{emulate 'tt -o my_dumb_test_parser.rb dumb'}
pf = "#{@tmpdir}/my_dumb_test_parser.rb"
begin
- system("ruby -S tt -o #{pf} #{@test_path}").should be_truthy
+ system("${RUBY} -S tt -o #{pf} #{@test_path}").should be_truthy
File.exists?(pf).should be_truthy
File.zero?(pf).should_not be_truthy
@@ -92,7 +92,7 @@ describe "The 'tt' comand line compiler" do
# puts %q{emulate 'tt -o must_save_parser.rb dumb'}
pf = "#{@tmpdir}/must_save_parser.rb"
begin
- system("ruby -S tt -o #{pf} #{@test_path}").should be_truthy
+ system("${RUBY} -S tt -o #{pf} #{@test_path}").should be_truthy
File.exists?(pf).should be_truthy
File.zero?(pf).should_not be_truthy
@@ -121,7 +121,7 @@ describe "The 'tt' comand line compiler" do
# puts %q{emulate 'tt -o must_save_parser.rb dumb'}
pf = "#{@tmpdir}/must_save_parser.rb"
begin
- system("ruby -S tt -o #{pf} #{@test_path}").should be_truthy
+ system("${RUBY} -S tt -o #{pf} #{@test_path}").should be_truthy
File.exists?(pf).should be_truthy
File.zero?(pf).should_not be_truthy
@@ -130,7 +130,7 @@ describe "The 'tt' comand line compiler" do
# Modify the file and make sure it gets reverted:
File.open(pf, "r+") { |f| f.gets; f.write("#") }
- system("ruby -S tt -o #{pf} #{@test_path}").should be_truthy
+ system("${RUBY} -S tt -o #{pf} #{@test_path}").should be_truthy
Digest::SHA1.hexdigest(File.read(pf)).should == orig_file_hash
ensure
File.delete(pf) if File.exists?(pf)
@@ -145,7 +145,7 @@ describe "The 'tt' comand line compiler" do
File.zero?(pf).should_not be_truthy
orig_file_hash = Digest::SHA1.hexdigest(File.read(pf))
- system("ruby -S tt -f #{@test_path}").should be_truthy
+ system("${RUBY} -S tt -f #{@test_path}").should be_truthy
Digest::SHA1.hexdigest(File.read(pf)).should_not == orig_file_hash
end
@@ -179,7 +179,7 @@ describe "The 'tt' comand line compiler" do
it 'can compile them in one invocation' do
# puts %q{emulate 'tt dumb1.tt dumb2.tt'}
- system("ruby -S tt #{@test_grammars.join(' ')}").should be_truthy
+ system("${RUBY} -S tt #{@test_grammars.join(' ')}").should be_truthy
@test_bases.each do |f|
pf = "#{f}.rb"
@@ -190,7 +190,7 @@ describe "The 'tt' comand line compiler" do
it 'can compile them without explicit file extenstions' do
# puts %q{emulate 'tt dumb1 dumb2'}
- system("ruby -S tt #{@test_bases.join(' ')}").should be_truthy
+ system("${RUBY} -S tt #{@test_bases.join(' ')}").should be_truthy
@test_bases.each do |f|
pf = "#{f}.rb"
@@ -201,7 +201,7 @@ describe "The 'tt' comand line compiler" do
it 'can skip nonexistent and invalid extension named grammar files' do
# puts %q{emulate 'tt not_here bad_ext.ttg dumb1 dumb2'}
- system("ruby -S tt not_here bad_ext.ttg #{@test_bases.join(' ')} >/dev/null 2>&1").should be_truthy
+ system("${RUBY} -S tt not_here bad_ext.ttg #{@test_bases.join(' ')} >/dev/null 2>&1").should be_truthy
File.exists?('not_here.rb').should_not be_truthy
File.exists?('bad_ext.rb').should_not be_truthy
@@ -216,7 +216,7 @@ describe "The 'tt' comand line compiler" do
it 'can not specify an output file' do
# puts %q{emulate 'tt -o my_bogus_test_parser.rb dumb1 dumb2'}
pf = 'my_bogus_test_parser.rb'
- system("ruby -S tt -o #{pf} #{@test_bases.join(' ')} >/dev/null 2>&1").should be_falsy
+ system("${RUBY} -S tt -o #{pf} #{@test_bases.join(' ')} >/dev/null 2>&1").should be_falsy
File.exists?(pf).should be_falsy
end
end