@@ -12,10 +12,6 @@ describe('index.js', () => {
1212 process . stdout . write = jest . fn ( )
1313 } )
1414
15- afterEach ( ( ) => {
16- fs . rm ( "tmp/dev.yml" , err => { } )
17- } )
18-
1915 test ( 'no-op when the dev.yml file is not present' , ( ) => {
2016 getRubyVersion ( 'dev.yml' )
2117
@@ -26,38 +22,19 @@ describe('index.js', () => {
2622 } )
2723
2824 test ( 'no-op when the dev.yml file does not specify a ruby version' , ( ) => {
29- yamlContent = `
30- up:
31- - ruby
32- - bla
33- `
34- fs . writeFileSync ( 'tmp/dev.yml' , yamlContent , err => { } )
35-
36- getRubyVersion ( 'tmp/dev.yml' )
25+ getRubyVersion ( '__fixtures__/dev-no-ruby-version.yml' )
3726
3827 expect ( process . stdout . write ) . not . toHaveBeenCalled ( )
3928 } )
4029
4130 test ( 'no-op when the dev.yml file does not specify a "up" key' , ( ) => {
42- yamlContent = `
43- - bla
44- `
45- fs . writeFileSync ( 'tmp/dev.yml' , yamlContent , err => { } )
46-
47- getRubyVersion ( 'tmp/dev.yml' )
31+ getRubyVersion ( '__fixtures__/dev-no-up.yml' )
4832
4933 expect ( process . stdout . write ) . not . toHaveBeenCalled ( )
5034 } )
5135
5236 test ( 'get the ruby version when the dev.yml has a ruby nested version' , ( ) => {
53- yamlContent = `
54- up:
55- - ruby:
56- version: 3.3.1
57- `
58- fs . writeFileSync ( 'tmp/dev.yml' , yamlContent , err => { } )
59-
60- getRubyVersion ( 'tmp/dev.yml' )
37+ getRubyVersion ( '__fixtures__/dev-ruby-version-nested.yml' )
6138
6239 expect ( process . stdout . write ) . toHaveBeenCalledTimes ( 3 )
6340 expect ( process . stdout . write . mock . calls ) . toEqual ( [
@@ -68,13 +45,7 @@ describe('index.js', () => {
6845 } )
6946
7047 test ( 'get the ruby version when the dev.yml has a ruby version' , ( ) => {
71- yamlContent = `
72- up:
73- - ruby: 3.3.1
74- `
75- fs . writeFileSync ( 'tmp/dev.yml' , yamlContent , err => { } )
76-
77- getRubyVersion ( 'tmp/dev.yml' )
48+ getRubyVersion ( '__fixtures__/dev.yml' )
7849
7950 expect ( process . stdout . write . mock . calls ) . toEqual ( [
8051 [ 'Ruby version 3.3.1 detected. Saving for later...\n' ] ,
0 commit comments