Skip to content

Commit 3840fbc

Browse files
committed
Cleanup
1 parent f250d1a commit 3840fbc

File tree

7 files changed

+13
-226
lines changed

7 files changed

+13
-226
lines changed
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
up:
2+
- ruby
3+
- bla

__fixtures__/dev-no-up.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
ruby:
2+
version: 3.1.2
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
up:
2+
- ruby:
3+
version: 3.3.1

__fixtures__/dev.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,2 @@
11
up:
2-
- ruby:
3-
version: 3.3.5
2+
- ruby: 3.3.1

__tests__/index.test.js

Lines changed: 4 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -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'],

db/schema.rb

Lines changed: 0 additions & 191 deletions
This file was deleted.

tmp/.gitkeep

Whitespace-only changes.

0 commit comments

Comments
 (0)