Skip to content
This repository has been archived by the owner on Aug 7, 2023. It is now read-only.

Commit

Permalink
fix: 'Naming/FileName' rule on test tmp file
Browse files Browse the repository at this point in the history
Rubocop warns about filenames without underscores and with numbers or symbols.
  • Loading branch information
vzamanillo committed May 30, 2019
1 parent 2b5c5db commit 07c3453
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions spec/linter-rubocop-spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import {
// eslint-disable-next-line no-unused-vars
it, fit, wait, beforeEach, afterEach,
} from 'jasmine-fix'
import { truncateSync, writeFileSync, readFileSync } from 'fs'
import { copyFileSync } from 'fs'

const { lint } = require('../src/index.js').provideLinter()

Expand Down Expand Up @@ -158,15 +158,11 @@ describe('The RuboCop provider for Linter', () => {
})

describe('allows the user to autocorrect the current file', () => {
const tmpobj = tmp.fileSync({ postfix: '.rb' })

beforeEach(() => {
truncateSync(tmpobj.name)
})
const tmpFile = `${tmp.dirSync().name}/invalid_with_url.rb`

it('corrects the bad file', async () => {
writeFileSync(tmpobj.name, readFileSync(invalidWithUrlPath))
const editor = await atom.workspace.open(tmpobj.name)
copyFileSync(invalidWithUrlPath, tmpFile)
const editor = await atom.workspace.open(tmpFile)
atom.commands.dispatch(atom.views.getView(editor), 'linter-rubocop:fix-file')
const expectedMessage = 'Linter-Rubocop: Fixed'
const notification = await getNotification(expectedMessage)
Expand Down

0 comments on commit 07c3453

Please sign in to comment.