Skip to content

Commit

Permalink
JSHintBearTest: Stop using prepare_file()
Browse files Browse the repository at this point in the history
prepare_file() does not work in configs due to a previously
known bug. This commit removes that usage in JSHintBear so that
the tests run correctly now.
  • Loading branch information
AbdealiLoKo committed Apr 26, 2016
1 parent 7d27b79 commit ede8a07
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 15 deletions.
25 changes: 10 additions & 15 deletions tests/js/JSHintBearTest.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import os

from bears.js.JSHintBear import JSHintBear
from tests.LocalBearTestHelper import verify_local_bear
from coalib.misc.ContextManagers import prepare_file
Expand All @@ -20,12 +22,9 @@
""".splitlines(keepends=True)


config_file = """
{
"lastsemic": true,
"maxlen": 80
}
""".splitlines(keepends=True)
jshintconfig = os.path.join(os.path.dirname(__file__),
"test_files",
"jshintconfig.json")


settings = {
Expand All @@ -44,15 +43,11 @@
test_file3))


with prepare_file(config_file,
filename=None,
force_linebreaks=True,
create_tempfile=True) as (conf_lines, conf_file):
JSHintBearConfigFileTest = verify_local_bear(
JSHintBear,
valid_files=(test_file1, test_file2),
invalid_files=(),
settings={"jshint_config": conf_file})
JSHintBearConfigFileTest = verify_local_bear(
JSHintBear,
valid_files=(test_file1,),
invalid_files=(test_file2,),
settings={"jshint_config": jshintconfig})


JSHintBearCoafileTest = verify_local_bear(
Expand Down
4 changes: 4 additions & 0 deletions tests/js/test_files/jshintconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"lastsemic": true,
"maxlen": 80
}

0 comments on commit ede8a07

Please sign in to comment.