mirror of
https://github.com/pulsar-edit/pulsar.git
synced 2024-09-11 11:15:24 +03:00
Manual decaf language-ruby-on-rails
spec
This commit is contained in:
parent
09a3278ae0
commit
26624c0acd
@ -1,29 +0,0 @@
|
|||||||
describe "Ruby on Rails package", ->
|
|
||||||
beforeEach ->
|
|
||||||
waitsForPromise ->
|
|
||||||
atom.packages.activatePackage("language-ruby-on-rails")
|
|
||||||
|
|
||||||
it "parses the HTML grammar", ->
|
|
||||||
grammar = atom.grammars.grammarForScopeName("text.html.ruby")
|
|
||||||
expect(grammar).toBeDefined()
|
|
||||||
expect(grammar.scopeName).toBe "text.html.ruby"
|
|
||||||
|
|
||||||
it "parses the JavaScript grammar", ->
|
|
||||||
grammar = atom.grammars.grammarForScopeName("source.js.rails source.js.jquery")
|
|
||||||
expect(grammar).toBeDefined()
|
|
||||||
expect(grammar.scopeName).toBe "source.js.rails source.js.jquery"
|
|
||||||
|
|
||||||
it "parses the RJS grammar", ->
|
|
||||||
grammar = atom.grammars.grammarForScopeName("source.ruby.rails.rjs")
|
|
||||||
expect(grammar).toBeDefined()
|
|
||||||
expect(grammar.scopeName).toBe "source.ruby.rails.rjs"
|
|
||||||
|
|
||||||
it "parses the Rails grammar", ->
|
|
||||||
grammar = atom.grammars.grammarForScopeName("source.ruby.rails")
|
|
||||||
expect(grammar).toBeDefined()
|
|
||||||
expect(grammar.scopeName).toBe "source.ruby.rails"
|
|
||||||
|
|
||||||
it "parses the SQL grammar", ->
|
|
||||||
grammar = atom.grammars.grammarForScopeName("source.sql.ruby")
|
|
||||||
expect(grammar).toBeDefined()
|
|
||||||
expect(grammar.scopeName).toBe "source.sql.ruby"
|
|
@ -1,38 +1,34 @@
|
|||||||
/*
|
|
||||||
* decaffeinate suggestions:
|
describe("Ruby on Rails package", () => {
|
||||||
* DS102: Remove unnecessary code created because of implicit returns
|
|
||||||
* Full docs: https://github.com/decaffeinate/decaffeinate/blob/main/docs/suggestions.md
|
|
||||||
*/
|
|
||||||
describe("Ruby on Rails package", function() {
|
|
||||||
beforeEach(() => waitsForPromise(() => atom.packages.activatePackage("language-ruby-on-rails")));
|
beforeEach(() => waitsForPromise(() => atom.packages.activatePackage("language-ruby-on-rails")));
|
||||||
|
|
||||||
it("parses the HTML grammar", function() {
|
it("parses the HTML grammar", () => {
|
||||||
const grammar = atom.grammars.grammarForScopeName("text.html.ruby");
|
const grammar = atom.grammars.grammarForScopeName("text.html.ruby");
|
||||||
expect(grammar).toBeDefined();
|
expect(grammar).toBeDefined();
|
||||||
return expect(grammar.scopeName).toBe("text.html.ruby");
|
expect(grammar.scopeName).toBe("text.html.ruby");
|
||||||
});
|
});
|
||||||
|
|
||||||
it("parses the JavaScript grammar", function() {
|
it("parses the JavaScript grammar", () => {
|
||||||
const grammar = atom.grammars.grammarForScopeName("source.js.rails source.js.jquery");
|
const grammar = atom.grammars.grammarForScopeName("source.js.rails source.js.jquery");
|
||||||
expect(grammar).toBeDefined();
|
expect(grammar).toBeDefined();
|
||||||
return expect(grammar.scopeName).toBe("source.js.rails source.js.jquery");
|
expect(grammar.scopeName).toBe("source.js.rails source.js.jquery");
|
||||||
});
|
});
|
||||||
|
|
||||||
it("parses the RJS grammar", function() {
|
it("parses the RJS grammar", () => {
|
||||||
const grammar = atom.grammars.grammarForScopeName("source.ruby.rails.rjs");
|
const grammar = atom.grammars.grammarForScopeName("source.ruby.rails.rjs");
|
||||||
expect(grammar).toBeDefined();
|
expect(grammar).toBeDefined();
|
||||||
return expect(grammar.scopeName).toBe("source.ruby.rails.rjs");
|
expect(grammar.scopeName).toBe("source.ruby.rails.rjs");
|
||||||
});
|
});
|
||||||
|
|
||||||
it("parses the Rails grammar", function() {
|
it("parses the Rails grammar", () => {
|
||||||
const grammar = atom.grammars.grammarForScopeName("source.ruby.rails");
|
const grammar = atom.grammars.grammarForScopeName("source.ruby.rails");
|
||||||
expect(grammar).toBeDefined();
|
expect(grammar).toBeDefined();
|
||||||
return expect(grammar.scopeName).toBe("source.ruby.rails");
|
expect(grammar.scopeName).toBe("source.ruby.rails");
|
||||||
});
|
});
|
||||||
|
|
||||||
return it("parses the SQL grammar", function() {
|
it("parses the SQL grammar", () => {
|
||||||
const grammar = atom.grammars.grammarForScopeName("source.sql.ruby");
|
const grammar = atom.grammars.grammarForScopeName("source.sql.ruby");
|
||||||
expect(grammar).toBeDefined();
|
expect(grammar).toBeDefined();
|
||||||
return expect(grammar.scopeName).toBe("source.sql.ruby");
|
expect(grammar.scopeName).toBe("source.sql.ruby");
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
@ -1,29 +0,0 @@
|
|||||||
describe "Ruby on Rails snippets", ->
|
|
||||||
grammar = null
|
|
||||||
|
|
||||||
beforeEach ->
|
|
||||||
waitsForPromise ->
|
|
||||||
atom.packages.activatePackage("language-ruby-on-rails")
|
|
||||||
|
|
||||||
runs ->
|
|
||||||
grammar = atom.grammars.grammarForScopeName("source.ruby.rails")
|
|
||||||
|
|
||||||
it "tokenizes ActionMailer::Base", ->
|
|
||||||
railsMailer = 'class RailsMailer < ActionMailer::Base'
|
|
||||||
{tokens} = grammar.tokenizeLine railsMailer
|
|
||||||
expect(tokens[0]).toEqual value: railsMailer, scopes: ['source.ruby.rails', 'meta.rails.mailer']
|
|
||||||
|
|
||||||
it "tokenizes ApplicationMailer", ->
|
|
||||||
rails5Mailer = 'class Rails5Mailer < ApplicationMailer'
|
|
||||||
{tokens} = grammar.tokenizeLine rails5Mailer
|
|
||||||
expect(tokens[0]).toEqual value: rails5Mailer, scopes: ['source.ruby.rails', 'meta.rails.mailer']
|
|
||||||
|
|
||||||
it "tokenizes ActiveRecord::Base", ->
|
|
||||||
railsModel = 'class RailsModel < ActiveRecord::Base'
|
|
||||||
{tokens} = grammar.tokenizeLine railsModel
|
|
||||||
expect(tokens[0]).toEqual value: railsModel, scopes: ['source.ruby.rails', 'meta.rails.model']
|
|
||||||
|
|
||||||
it "tokenizes ApplicationRecord", ->
|
|
||||||
rails5Model = 'class Rails5Model < ApplicationRecord'
|
|
||||||
{tokens} = grammar.tokenizeLine rails5Model
|
|
||||||
expect(tokens[0]).toEqual value: rails5Model, scopes: ['source.ruby.rails', 'meta.rails.model']
|
|
@ -1,38 +1,34 @@
|
|||||||
/*
|
|
||||||
* decaffeinate suggestions:
|
describe("Ruby on Rails snippets", () => {
|
||||||
* DS102: Remove unnecessary code created because of implicit returns
|
|
||||||
* Full docs: https://github.com/decaffeinate/decaffeinate/blob/main/docs/suggestions.md
|
|
||||||
*/
|
|
||||||
describe("Ruby on Rails snippets", function() {
|
|
||||||
let grammar = null;
|
let grammar = null;
|
||||||
|
|
||||||
beforeEach(function() {
|
beforeEach(() => {
|
||||||
waitsForPromise(() => atom.packages.activatePackage("language-ruby-on-rails"));
|
waitsForPromise(() => atom.packages.activatePackage("language-ruby-on-rails"));
|
||||||
|
|
||||||
return runs(() => grammar = atom.grammars.grammarForScopeName("source.ruby.rails"));
|
runs(() => grammar = atom.grammars.grammarForScopeName("source.ruby.rails"));
|
||||||
});
|
});
|
||||||
|
|
||||||
it("tokenizes ActionMailer::Base", function() {
|
it("tokenizes ActionMailer::Base", () => {
|
||||||
const railsMailer = 'class RailsMailer < ActionMailer::Base';
|
const railsMailer = 'class RailsMailer < ActionMailer::Base';
|
||||||
const {tokens} = grammar.tokenizeLine(railsMailer);
|
const {tokens} = grammar.tokenizeLine(railsMailer);
|
||||||
return expect(tokens[0]).toEqual({value: railsMailer, scopes: ['source.ruby.rails', 'meta.rails.mailer']});
|
expect(tokens[0]).toEqual({value: railsMailer, scopes: ['source.ruby.rails', 'meta.rails.mailer']});
|
||||||
});
|
});
|
||||||
|
|
||||||
it("tokenizes ApplicationMailer", function() {
|
it("tokenizes ApplicationMailer", () => {
|
||||||
const rails5Mailer = 'class Rails5Mailer < ApplicationMailer';
|
const rails5Mailer = 'class Rails5Mailer < ApplicationMailer';
|
||||||
const {tokens} = grammar.tokenizeLine(rails5Mailer);
|
const {tokens} = grammar.tokenizeLine(rails5Mailer);
|
||||||
return expect(tokens[0]).toEqual({value: rails5Mailer, scopes: ['source.ruby.rails', 'meta.rails.mailer']});
|
expect(tokens[0]).toEqual({value: rails5Mailer, scopes: ['source.ruby.rails', 'meta.rails.mailer']});
|
||||||
});
|
});
|
||||||
|
|
||||||
it("tokenizes ActiveRecord::Base", function() {
|
it("tokenizes ActiveRecord::Base", () => {
|
||||||
const railsModel = 'class RailsModel < ActiveRecord::Base';
|
const railsModel = 'class RailsModel < ActiveRecord::Base';
|
||||||
const {tokens} = grammar.tokenizeLine(railsModel);
|
const {tokens} = grammar.tokenizeLine(railsModel);
|
||||||
return expect(tokens[0]).toEqual({value: railsModel, scopes: ['source.ruby.rails', 'meta.rails.model']});
|
expect(tokens[0]).toEqual({value: railsModel, scopes: ['source.ruby.rails', 'meta.rails.model']});
|
||||||
});
|
});
|
||||||
|
|
||||||
return it("tokenizes ApplicationRecord", function() {
|
it("tokenizes ApplicationRecord", () => {
|
||||||
const rails5Model = 'class Rails5Model < ApplicationRecord';
|
const rails5Model = 'class Rails5Model < ApplicationRecord';
|
||||||
const {tokens} = grammar.tokenizeLine(rails5Model);
|
const {tokens} = grammar.tokenizeLine(rails5Model);
|
||||||
return expect(tokens[0]).toEqual({value: rails5Model, scopes: ['source.ruby.rails', 'meta.rails.model']});
|
expect(tokens[0]).toEqual({value: rails5Model, scopes: ['source.ruby.rails', 'meta.rails.model']});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
Loading…
Reference in New Issue
Block a user