Skip to content

Commit 949f539

Browse files
committed
WIP
1 parent fd30e2f commit 949f539

File tree

1 file changed

+20
-16
lines changed

1 file changed

+20
-16
lines changed

test/cli_test.rb

Lines changed: 20 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -4,37 +4,41 @@
44

55
module EasyCompile
66
class CLITest < Minitest::Test
7+
def setup
8+
super
9+
10+
@dllext = RbConfig::MAKEFILE_CONFIG["DLEXT"]
11+
end
12+
713
def test_compile
8-
binary_path = "test/fixtures/dummy_gem/lib/hello_world.bundle"
14+
binary_path = "test/fixtures/dummy_gem/lib/hello_world.#{@dllext}"
915

1016
Dir.chdir("test/fixtures/dummy_gem") do
11-
# capture_subprocess_io do
17+
capture_subprocess_io do
1218
CLI.start(["compile"])
13-
# end
19+
end
1420
end
1521

16-
puts Dir.entries("./test/fixtures/dummy_gem/lib")
17-
1822
assert(File.exist?(binary_path))
1923
ensure
2024
FileUtils.rm_rf(binary_path)
2125
end
2226

2327
def test_clean
24-
binary_path = "test/fixtures/dummy_gem/tmp/#{RUBY_PLATFORM}/hello_world/#{RUBY_VERSION}/hello_world.bundle"
28+
binary_path = "test/fixtures/dummy_gem/tmp/#{RUBY_PLATFORM}/hello_world/#{RUBY_VERSION}/hello_world.#{@dllext}"
2529

2630
Dir.chdir("test/fixtures/dummy_gem") do
27-
# capture_subprocess_io do
31+
capture_subprocess_io do
2832
CLI.start(["compile"])
29-
# end
33+
end
3034
end
3135

3236
assert(File.exist?(binary_path))
3337

3438
Dir.chdir("test/fixtures/dummy_gem") do
35-
# capture_subprocess_io do
39+
capture_subprocess_io do
3640
CLI.start(["clean"])
37-
# end
41+
end
3842
end
3943

4044
refute(File.exist?(binary_path))
@@ -46,9 +50,9 @@ def test_clobber
4650
FileUtils.mkdir_p(pkg_folder)
4751

4852
Dir.chdir("test/fixtures/dummy_gem") do
49-
# capture_subprocess_io do
53+
capture_subprocess_io do
5054
CLI.start(["clobber"])
51-
# end
55+
end
5256
end
5357

5458
refute(Dir.exist?(pkg_folder))
@@ -59,9 +63,9 @@ def test_ci_template
5963

6064
expected_workflow = File.read("test/fixtures/expected_github_workflow.yml")
6165
Dir.chdir("test/fixtures/dummy_gem") do
62-
# capture_subprocess_io do
66+
capture_subprocess_io do
6367
CLI.start(["ci_template"])
64-
# end
68+
end
6569
end
6670

6771
assert(File.exist?(workflow_path))
@@ -75,9 +79,9 @@ def test_ci_template_when_passed_a_working_directory
7579

7680
expected_workflow = File.read("test/fixtures/expected_github_workflow_working_dir.yml")
7781
Dir.chdir("test/fixtures/dummy_gem") do
78-
# capture_subprocess_io do
82+
capture_subprocess_io do
7983
CLI.start(["ci_template", "--working-directory", "test/fixtures/date"])
80-
# end
84+
end
8185
end
8286

8387
assert(File.exist?(workflow_path))

0 commit comments

Comments
 (0)