|
54 | 54 | Dir.chdir(dir) do |
55 | 55 | FileUtils.rm( |
56 | 56 | Dir.glob( |
57 | | - "#{dir}/#{name}.{c,h,so,o,bundle,dll}") + ["Makefile", "extconf.rb"], force: true |
| 57 | + "#{dir}/*.{c,h,so,o,bundle,dll}") + ["Makefile", "extconf.rb"], force: true |
58 | 58 | ) |
59 | 59 | end |
60 | 60 | FileUtils.rmdir(dir) |
|
74 | 74 | Rake::Task.clear |
75 | 75 | end |
76 | 76 |
|
77 | | - it "generates the shared object file after compilation" do |
78 | | - ext_path = "#{Dir.pwd}/spec/fixtures/rake_task/single_file" |
79 | | - name = "test" |
80 | | - Rubex::RakeTask.new(name) do |
81 | | - ext ext_path |
82 | | - end |
83 | | - Rake::Task["rubex:compile:install"].invoke |
| 77 | + context "for single file" do |
| 78 | + it "generates the shared object file after compilation" do |
| 79 | + ext_path = "#{Dir.pwd}/spec/fixtures/rake_task/single_file" |
| 80 | + name = "test" |
| 81 | + Rubex::RakeTask.new(name) do |
| 82 | + ext ext_path |
| 83 | + end |
| 84 | + Rake::Task["rubex:compile:install"].invoke |
84 | 85 |
|
85 | | - expect(File.exist?("#{ext_path}/#{name}/#{name}.c")).to eq(true) |
86 | | - expect(File.exist?("#{ext_path}/#{name}/extconf.rb")).to eq(true) |
87 | | - expect(File.exist?("#{ext_path}/#{name}/#{name}.so")).to eq(true) |
| 86 | + expect(File.exist?("#{ext_path}/#{name}/#{name}.c")).to eq(true) |
| 87 | + expect(File.exist?("#{ext_path}/#{name}/extconf.rb")).to eq(true) |
| 88 | + expect(File.exist?("#{ext_path}/#{name}/#{name}.so")).to eq(true) |
88 | 89 |
|
89 | | - # delete generated files |
90 | | - dir = "#{ext_path}/#{name}" |
91 | | - Dir.chdir(dir) do |
92 | | - FileUtils.rm( |
93 | | - Dir.glob( |
94 | | - "#{dir}/#{name}.{c,h,so,o,bundle,dll}") + ["Makefile", "extconf.rb"], |
95 | | - force: true |
96 | | - ) |
| 90 | + # delete generated files |
| 91 | + dir = "#{ext_path}/#{name}" |
| 92 | + Dir.chdir(dir) do |
| 93 | + FileUtils.rm( |
| 94 | + Dir.glob( |
| 95 | + "#{dir}/#{name}.{c,h,so,o,bundle,dll}") + ["Makefile", "extconf.rb"], |
| 96 | + force: true |
| 97 | + ) |
| 98 | + end |
| 99 | + FileUtils.rmdir(dir) |
| 100 | + end |
| 101 | + end |
| 102 | + |
| 103 | + context "for multi file" do |
| 104 | + skip "generates .so file after compilation" do |
| 105 | + # TODO |
97 | 106 | end |
98 | | - FileUtils.rmdir(dir) |
99 | 107 | end |
100 | 108 | end |
101 | 109 | end |
0 commit comments