Skip to content

Commit 81b44d4

Browse files
authored
Merge pull request #78 from sue445/ckeck_file_content
Check file content
2 parents e690e3a + 3baf2e4 commit 81b44d4

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

_tools/patch_for_go_gem/spec/patch_for_go_gem_spec.rb

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,11 +55,34 @@ def sh(command)
5555
describe file(File.join(gem_name, "ext", gem_name, "#{gem_name}.go")) do
5656
it { should be_file }
5757
it { should exist }
58+
59+
let(:content) do
60+
<<~GO
61+
package main
62+
63+
/*
64+
#include "#{gem_name}.h"
65+
*/
66+
import "C"
67+
68+
GO
69+
end
70+
71+
its(:content) { should be_start_with content }
5872
end
5973

6074
describe file(File.join(gem_name, "ext", gem_name, "go.mod")) do
6175
it { should be_file }
6276
it { should exist }
77+
78+
let(:content) do
79+
<<~GO
80+
module github.com/username/#{gem_name}
81+
82+
GO
83+
end
84+
85+
its(:content) { should be_start_with content }
6386
end
6487

6588
describe file(File.join(gem_name, "ext", gem_name, "extconf.rb")) do

0 commit comments

Comments
 (0)