Skip to content

Commit

Permalink
See #18. Use default config options instead of Atom Editor for specs
Browse files Browse the repository at this point in the history
  • Loading branch information
Glavin001 committed Dec 28, 2014
1 parent 8cbc874 commit 314c267
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
13 changes: 8 additions & 5 deletions lib/options.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,8 @@ module.exports =
return proj if proj
return home if @verifyExists(home)
null
getConfigOptionsFromSettings: (langs) ->
config = atom.config.get('atom-beautify')
getConfigOptionsFromSettings: (langs, config) ->
config ?= atom.config.get('atom-beautify')
options = {}
# console.log(langs, config);
# Iterate over keys of the settings
Expand Down Expand Up @@ -140,9 +140,12 @@ module.exports =
indent_size: (if softTabs then tabLength else 1)
indent_char: (if softTabs then " " else "\t")
indent_with_tabs: not softTabs

# From Package Settings
configOptions = @getConfigOptionsFromSettings(languages)
# From Package Settings
configOptions = @getConfigOptionsFromSettings(languages)
else
# Without editor
# Use default options for Atom editor
configOptions = @getConfigOptionsFromSettings(languages, defaultLanguageOptions)

# Get configuration in User's Home directory
userHome = @getUserHome()
Expand Down
1 change: 1 addition & 0 deletions spec/beautify-languages-spec.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,7 @@ describe "BeautifyLanguages", ->
# expect(grammar).toEqual("test")
grammarName = grammar.name

# Get the options
allOptions = options.getOptionsForPath(originalTestPath)

beautifyCompleted = false
Expand Down

0 comments on commit 314c267

Please sign in to comment.