forked from pantsbuild/pants
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix problem parsing stuff like options: --compile-java-args='-target …
…7 -source 7' in pants.rc files Testing Done: Ran new tests Reviewed at https://rbcommons.com/s/twitter/r/1192/
- Loading branch information
1 parent
633bd56
commit 77ccbb6
Showing
4 changed files
with
42 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
# coding=utf-8 | ||
# Copyright 2014 Pants project contributors (see CONTRIBUTORS.md). | ||
# Licensed under the Apache License, Version 2.0 (see LICENSE). | ||
|
||
from __future__ import (nested_scopes, generators, division, absolute_import, with_statement, | ||
print_function, unicode_literals) | ||
|
||
from contextlib import contextmanager | ||
from textwrap import dedent | ||
import os | ||
import unittest2 as unittest | ||
|
||
from pants.base.rcfile import RcFile | ||
from pants.util.contextutil import temporary_file | ||
|
||
|
||
class ParseSpecTest(unittest.TestCase): | ||
def test_parse_rcfile(self): | ||
with temporary_file() as rc: | ||
rc.write(dedent(""" | ||
[jvm] | ||
options: --compile-java-args='-target 7 -source 7' | ||
""")) | ||
rc.close() | ||
rcfile = RcFile([rc.name], default_prepend=False) | ||
commands = ['jvm', 'fleem'] | ||
args = ['javac', 'Foo.java'] | ||
new_args = rcfile.apply_defaults(commands, args) | ||
self.assertEquals(['javac', 'Foo.java', '--compile-java-args=-target 7 -source 7'], new_args) |