Skip to content

Loading…

update unit tests now that shell mode is a default language #3380

Merged
merged 1 commit into from

2 participants

@jasonsanjose
Adobe Systems Incorporated member

Fixes unit test failure after merging #3348

@iwehrman or @DennisKehrig would be ideal to review

@redmunds

Looks good. Merging.

@redmunds redmunds merged commit 74a6a86 into master

1 check passed

Details default The Travis build passed
@redmunds redmunds deleted the jasonsanjose/fix-lang-tests branch
@redmunds redmunds referenced this pull request
Commit has since been removed from the repository and is no longer available.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
This page is out of date. Refresh to see the latest.
Showing with 16 additions and 17 deletions.
  1. +16 −17 test/spec/LanguageManager-test.js
View
33 test/spec/LanguageManager-test.js
@@ -448,19 +448,19 @@ define(function (require, exports, module) {
// cleanup
doc.releaseRef();
});
-
+
it("should update the document's language when a language is added", function () {
var unknown,
doc,
spy,
- shellLanguage,
+ schemeLanguage,
promise;
runs(function () {
- // Create a shell script file
- doc = SpecRunnerUtils.createMockActiveDocument({ filename: "build.sh" });
+ // Create a scheme script file
+ doc = SpecRunnerUtils.createMockActiveDocument({ filename: "file.scheme" });
- // Initial language will be unknown (shell is not a default language)
+ // Initial language will be unknown (scheme is not a default language)
unknown = LanguageManager.getLanguage("unknown");
// listen for event
@@ -473,28 +473,27 @@ define(function (require, exports, module) {
// make active
doc.addRef();
- // Add the shell language, DocumentManager should update all open documents
- promise = LanguageManager.defineLanguage("shell", {
- name: "Shell",
- mode: "shell",
- fileExtensions: ["sh"],
- lineComment: "#"
+ // Add the scheme language, DocumentManager should update all open documents
+ promise = LanguageManager.defineLanguage("scheme", {
+ name: "Scheme",
+ mode: "scheme",
+ fileExtensions: ["scheme"]
}).done(function (language) {
- shellLanguage = language;
+ schemeLanguage = language;
});
- waitsForDone(promise, "loading shell mode", 1000);
+ waitsForDone(promise, "loading scheme mode", 1000);
});
runs(function () {
// language should change
- expect(doc.getLanguage()).toBe(shellLanguage);
+ expect(doc.getLanguage()).toBe(schemeLanguage);
expect(spy).toHaveBeenCalled();
expect(spy.callCount).toEqual(1);
// check callback args (arg 0 is a jQuery event)
expect(spy.mostRecentCall.args[1]).toBe(unknown);
- expect(spy.mostRecentCall.args[2]).toBe(shellLanguage);
+ expect(spy.mostRecentCall.args[2]).toBe(schemeLanguage);
// cleanup
doc.releaseRef();
@@ -508,10 +507,10 @@ define(function (require, exports, module) {
modifiedLanguage,
promise;
- // Create a shell script file
+ // Create a foo script file
doc = SpecRunnerUtils.createMockActiveDocument({ filename: "test.foo" });
- // Initial language will be unknown (shell is not a default language)
+ // Initial language will be unknown (foo is not a default language)
unknown = LanguageManager.getLanguage("unknown");
// listen for event
Something went wrong with that request. Please try again.