File tree Expand file tree Collapse file tree 4 files changed +64
-7
lines changed Expand file tree Collapse file tree 4 files changed +64
-7
lines changed Original file line number Diff line number Diff line change
1
+ # frozen_string_literal: true
2
+
3
+ require "mkmf"
4
+
5
+ module GoGem
6
+ # Helper module for creating Go Makefiles
7
+ module Mkmf
8
+ # @param target [String]
9
+ # @param srcprefix [String,nil]
10
+ def create_go_makefile ( target , srcprefix = nil )
11
+ create_makefile ( target , srcprefix )
12
+ end
13
+ end
14
+ end
15
+
16
+ include GoGem ::Mkmf # rubocop:disable Style/MixinUsage
Original file line number Diff line number Diff line change
1
+ # frozen_string_literal: true
2
+
3
+ RSpec . describe GoGem ::Mkmf do
4
+ describe "#create_go_makefile" do
5
+ gem_name = "new_gem"
6
+
7
+ before ( :all ) do
8
+ @temp_dir = Dir . mktmpdir
9
+
10
+ Dir . chdir ( @temp_dir ) do
11
+ create_go_makefile ( "#{ gem_name } /#{ gem_name } " )
12
+ end
13
+ end
14
+
15
+ after ( :all ) do
16
+ FileUtils . remove_entry_secure ( @temp_dir ) if @temp_dir && Dir . exist? ( @temp_dir )
17
+ end
18
+
19
+ around do |example |
20
+ Dir . chdir ( @temp_dir ) do
21
+ example . run
22
+ end
23
+ end
24
+
25
+ describe file ( "Makefile" ) do
26
+ it { should be_file }
27
+ it { should exist }
28
+
29
+ # content of create_makefile
30
+ its ( :content ) { should match ( %r{^SHELL = /bin/sh$} ) }
31
+
32
+ # content of create_go_makefile
33
+ its ( :content ) { should match ( %r{^\$ \( DLLIB\) : Makefile \$ \( srcdir\) /\* \. go$} ) }
34
+ end
35
+ end
36
+ end
Load Diff This file was deleted.
Original file line number Diff line number Diff line change 1
1
# frozen_string_literal: true
2
2
3
3
require "go_gem"
4
+ require "go_gem/mkmf"
5
+
6
+ require "tmpdir"
7
+ require "serverspec"
8
+
9
+ set :backend , :exec
4
10
5
11
RSpec . configure do |config |
6
12
# Enable flags like --only-failures and --next-failure
12
18
config . expect_with :rspec do |c |
13
19
c . syntax = :expect
14
20
end
21
+
22
+ config . filter_run_when_matching :focus
23
+
24
+ config . define_derived_metadata do |meta |
25
+ meta [ :aggregate_failures ] = true
26
+ end
15
27
end
You can’t perform that action at this time.
0 commit comments