Skip to content

Commit

Permalink
wrong setup and teadown
Browse files Browse the repository at this point in the history
  • Loading branch information
katsyoshi committed Aug 31, 2024
1 parent f06c56d commit 50427a2
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions test/vaporware/test_compiler.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,14 @@
require "test/unit"

class Vaporware::CompilerTest < Test::Unit::TestCase
def tear_down = File.delete("tmp") rescue File.delete(@generated)
def setup = @generated = ["tmp.s", "tmp.o"]
def teardown
File.delete("tmp") if File.exist?("tmp")
@generated.map { File.delete(_1) }
end
def test_sample_plus
@file = "sample/plus.rb"
@vaporware = Vaporware::Compiler.compile(@file, debug: true)
@vaporware = Vaporware::Compiler.compile(@file)
IO.popen("./tmp").close
exit_code, handle_code = check_process($?.to_i)
assert_equal(9, exit_code)
Expand Down Expand Up @@ -49,7 +53,7 @@ def test_sample_while
end

def test_sample_call_method
@generated = "libtmp.so"
@generated = ["libtmp.so", "libtmp.so.o", "libtmp.so.s"]
@file = "sample/method.rb"
@vaporware = Vaporware::Compiler.compile(@file, dest: "./libtmp.so", shared: true)
require './sample/fiddle.rb'
Expand Down

0 comments on commit 50427a2

Please sign in to comment.