69e4072f89
* master: (389 commits)
Document "No gems fetched from git repositories" policy [ci skip]
Typos
Small gramatical tweaks
Typos
Added PHP & NPM doc
Use `:empty_project` where possible in request specs
Add caching of droplab ajax requests
Use `:empty_project` where possible in model specs
Revert 3f17f29a
Remove unused js response from refs controller
Add MR id to changelog entry
fixed small mini pipeline graph line glitch
Prevent form to be submitted twice
Fix Error 500 when repositories contain annotated tags pointing to blobs
Fix /explore sorting (trending)
Simplify wording in "adding an image" docs
Remove "official merge window" from CONTRIBUTING.md [ci skip]
Update repository check documentation
Fixed flexbox and wrap issues
Update two_factor_authentication.md
...
36 lines
1.1 KiB
JavaScript
36 lines
1.1 KiB
JavaScript
/* 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();
|
|
});
|
|
});
|
|
});
|