@@ -9,6 +9,7 @@ def setup
99 "version" => "0.2" ,
1010 "target" => "ruby" ,
1111 "project_name" => "sample app" ,
12+ "mounts" => [ "/a:/b" ] ,
1213 "matrix" => {
1314 "ruby" => {
1415 "variants" => [
@@ -18,8 +19,8 @@ def setup
1819 } ,
1920 "active_model" => {
2021 "variants" => [
21- { "key" => "6.1" } ,
22- { "key" => "7.0" }
22+ { "key" => "6.1" , "mounts" => [ ".matrixeval/schema/rails_6_1.rb:/app/test/dummy/db/schema.rb" ] } ,
23+ { "key" => "7.0" , "mounts" => [ ".matrixeval/schema/rails_7_0.rb:/app/test/dummy/db/schema.rb" ] }
2324 ]
2425 }
2526 } ,
@@ -43,8 +44,36 @@ def test_target
4344 assert_equal "ruby" , Matrixeval ::Ruby ::Config . target
4445 end
4546
46- def project_name
47- assert_equal "sampe_app" , Matrixeval ::Ruby ::Config . project_name
47+ def test_project_name
48+ assert_equal "sample app" , Matrixeval ::Ruby ::Config . project_name
49+ end
50+
51+ def test_env
52+ Matrixeval ::Ruby ::Config ::YAML . stubs ( :yaml ) . returns ( { "env" => { 'A' => 'a' } } )
53+ assert_equal ( { 'A' => 'a' } , Matrixeval ::Ruby ::Config . env )
54+ end
55+
56+ def test_env_default
57+ Matrixeval ::Ruby ::Config ::YAML . stubs ( :yaml ) . returns ( { } )
58+ assert_equal ( { } , Matrixeval ::Ruby ::Config . env )
59+ end
60+
61+ def test_mounts
62+ Matrixeval ::Ruby ::Config ::YAML . stubs ( :yaml ) . returns ( { "mounts" => [ "/a:/b" ] } )
63+ assert_equal [ "/a:/b" ] , Matrixeval ::Ruby ::Config . mounts
64+ end
65+
66+ def test_mounts_default
67+ Matrixeval ::Ruby ::Config ::YAML . stubs ( :yaml ) . returns ( { } )
68+ assert_equal [ ] , Matrixeval ::Ruby ::Config . mounts
69+ end
70+
71+ def test_all_mounts
72+ assert_equal ( [
73+ "/a:/b" ,
74+ ".matrixeval/schema/rails_6_1.rb:/app/test/dummy/db/schema.rb" ,
75+ ".matrixeval/schema/rails_7_0.rb:/app/test/dummy/db/schema.rb"
76+ ] , Matrixeval ::Ruby ::Config . all_mounts )
4877 end
4978
5079 def test_vectors
@@ -94,10 +123,19 @@ def test_exclusions
94123
95124 def test_commands
96125 Matrixeval ::Ruby ::Config ::YAML . stubs ( :yaml ) . returns ( { } )
97- assert_equal [ 'rake' , 'rspec' , 'bundle' , 'bash' ] , Matrixeval ::Ruby ::Config . commands
126+ assert_equal ( [
127+ 'ruby' , 'rake' , 'rails' , 'rspec' , 'bundle' ,
128+ 'bin/rake' , 'bin/rails' , 'bin/rspec' , 'bin/test' ,
129+ 'bash' , 'dash' , 'sh' , 'zsh'
130+ ] , Matrixeval ::Ruby ::Config . commands )
98131
99132 Matrixeval ::Ruby ::Config ::YAML . stubs ( :yaml ) . returns ( { 'commands' => [ 'ls' ] } )
100- assert_equal [ 'rake' , 'rspec' , 'bundle' , 'bash' , 'ls' ] , Matrixeval ::Ruby ::Config . commands
133+ assert_equal ( [
134+ 'ruby' , 'rake' , 'rails' , 'rspec' , 'bundle' ,
135+ 'bin/rake' , 'bin/rails' , 'bin/rspec' , 'bin/test' ,
136+ 'bash' , 'dash' , 'sh' , 'zsh' ,
137+ 'ls'
138+ ] , Matrixeval ::Ruby ::Config . commands )
101139 end
102140
103141 def test_docker_compose_extend_raw
0 commit comments