mirror of
https://github.com/pulsar-edit/pulsar.git
synced 2024-11-11 04:48:44 +03:00
Throw when Config::set is called w/ source and no scope
This commit is contained in:
parent
2cea51b50e
commit
ab89776f01
@ -77,6 +77,9 @@ describe "Config", ->
|
||||
expect(atom.config.save).toHaveBeenCalled()
|
||||
expect(observeHandler).toHaveBeenCalledWith 42
|
||||
|
||||
it "does not allow a 'source' option without a 'scopeSelector'", ->
|
||||
expect(-> atom.config.set("foo", 1, source: [".source.ruby"])).toThrow()
|
||||
|
||||
describe "when the value equals the default value", ->
|
||||
it "does not store the value in the user's config", ->
|
||||
atom.config.setDefaults "foo",
|
||||
|
@ -541,6 +541,9 @@ class Config
|
||||
scopeSelector = options?.scopeSelector
|
||||
source = options?.source
|
||||
|
||||
if source and not scopeSelector
|
||||
throw new Error("::set with a 'source' and no 'sourceSelector' is not yet implemented!")
|
||||
|
||||
source ?= @getUserConfigPath()
|
||||
|
||||
unless value is undefined
|
||||
|
Loading…
Reference in New Issue
Block a user