From df469864b1ab1e0bfaa1e843d3d0a84042604646 Mon Sep 17 00:00:00 2001 From: "Luke \"Jared\" Bennett" Date: Tue, 7 Feb 2017 18:02:49 +0000 Subject: Updated the filename regex --- spec/javascripts/helpers/class_spec_helper.js | 9 ++++++ spec/javascripts/helpers/class_spec_helper.js.es6 | 9 ------ spec/javascripts/helpers/class_spec_helper_spec.js | 36 ++++++++++++++++++++++ .../helpers/class_spec_helper_spec.js.es6 | 36 ---------------------- 4 files changed, 45 insertions(+), 45 deletions(-) create mode 100644 spec/javascripts/helpers/class_spec_helper.js delete mode 100644 spec/javascripts/helpers/class_spec_helper.js.es6 create mode 100644 spec/javascripts/helpers/class_spec_helper_spec.js delete mode 100644 spec/javascripts/helpers/class_spec_helper_spec.js.es6 (limited to 'spec/javascripts/helpers') diff --git a/spec/javascripts/helpers/class_spec_helper.js b/spec/javascripts/helpers/class_spec_helper.js new file mode 100644 index 00000000000..d3c37d39431 --- /dev/null +++ b/spec/javascripts/helpers/class_spec_helper.js @@ -0,0 +1,9 @@ +class ClassSpecHelper { + static itShouldBeAStaticMethod(base, method) { + return it('should be a static method', () => { + expect(Object.prototype.hasOwnProperty.call(base, method)).toBeTruthy(); + }); + } +} + +window.ClassSpecHelper = ClassSpecHelper; diff --git a/spec/javascripts/helpers/class_spec_helper.js.es6 b/spec/javascripts/helpers/class_spec_helper.js.es6 deleted file mode 100644 index d3c37d39431..00000000000 --- a/spec/javascripts/helpers/class_spec_helper.js.es6 +++ /dev/null @@ -1,9 +0,0 @@ -class ClassSpecHelper { - static itShouldBeAStaticMethod(base, method) { - return it('should be a static method', () => { - expect(Object.prototype.hasOwnProperty.call(base, method)).toBeTruthy(); - }); - } -} - -window.ClassSpecHelper = ClassSpecHelper; diff --git a/spec/javascripts/helpers/class_spec_helper_spec.js b/spec/javascripts/helpers/class_spec_helper_spec.js new file mode 100644 index 00000000000..0a61e561640 --- /dev/null +++ b/spec/javascripts/helpers/class_spec_helper_spec.js @@ -0,0 +1,36 @@ +/* global ClassSpecHelper */ + +require('./class_spec_helper'); + +describe('ClassSpecHelper', () => { + describe('.itShouldBeAStaticMethod', function () { + beforeEach(() => { + class TestClass { + instanceMethod() { this.prop = 'val'; } + static staticMethod() {} + } + + this.TestClass = TestClass; + }); + + ClassSpecHelper.itShouldBeAStaticMethod(ClassSpecHelper, 'itShouldBeAStaticMethod'); + + it('should have a defined spec', () => { + expect(ClassSpecHelper.itShouldBeAStaticMethod(this.TestClass, 'staticMethod').description).toBe('should be a static method'); + }); + + it('should pass for a static method', () => { + const spec = ClassSpecHelper.itShouldBeAStaticMethod(this.TestClass, 'staticMethod'); + expect(spec.status()).toBe('passed'); + }); + + it('should fail for an instance method', (done) => { + const spec = ClassSpecHelper.itShouldBeAStaticMethod(this.TestClass, 'instanceMethod'); + spec.resultCallback = (result) => { + expect(result.status).toBe('failed'); + done(); + }; + spec.execute(); + }); + }); +}); diff --git a/spec/javascripts/helpers/class_spec_helper_spec.js.es6 b/spec/javascripts/helpers/class_spec_helper_spec.js.es6 deleted file mode 100644 index 0a61e561640..00000000000 --- a/spec/javascripts/helpers/class_spec_helper_spec.js.es6 +++ /dev/null @@ -1,36 +0,0 @@ -/* global ClassSpecHelper */ - -require('./class_spec_helper'); - -describe('ClassSpecHelper', () => { - describe('.itShouldBeAStaticMethod', function () { - beforeEach(() => { - class TestClass { - instanceMethod() { this.prop = 'val'; } - static staticMethod() {} - } - - this.TestClass = TestClass; - }); - - ClassSpecHelper.itShouldBeAStaticMethod(ClassSpecHelper, 'itShouldBeAStaticMethod'); - - it('should have a defined spec', () => { - expect(ClassSpecHelper.itShouldBeAStaticMethod(this.TestClass, 'staticMethod').description).toBe('should be a static method'); - }); - - it('should pass for a static method', () => { - const spec = ClassSpecHelper.itShouldBeAStaticMethod(this.TestClass, 'staticMethod'); - expect(spec.status()).toBe('passed'); - }); - - it('should fail for an instance method', (done) => { - const spec = ClassSpecHelper.itShouldBeAStaticMethod(this.TestClass, 'instanceMethod'); - spec.resultCallback = (result) => { - expect(result.status).toBe('failed'); - done(); - }; - spec.execute(); - }); - }); -}); -- cgit v1.2.1