Skip to content

Commit

Permalink
Rename all tests to remove the test prefix
Browse files Browse the repository at this point in the history
  • Loading branch information
steveukx committed Jun 17, 2019
1 parent 5fc89de commit 8899022
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 29 deletions.
4 changes: 2 additions & 2 deletions test/bind-to-server.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ describe('bind-to-server', () => {

afterEach(() => tempFile.tearDown());

it('test Creates directories when necessary - absolute paths', () => {
it('Creates directories when necessary - absolute paths', () => {
const dirPath = tempFile.pushDir('/tmp/' + Math.floor(Math.random() * 1e10).toString(16));
const app = {set: spy()};

Expand All @@ -32,7 +32,7 @@ describe('bind-to-server', () => {
expect(require('fs').statSync(dirPath).isDirectory()).to.be.ok();
});

it('test Creates directories when necessary - relative paths', () => {
it('Creates directories when necessary - relative paths', () => {
const dirName = Math.floor(Math.random() * 1e10).toString(16);
const dirBase = process.cwd();
const dirPath = tempFile.pushDir(dirBase + '/' + dirName);
Expand Down
32 changes: 16 additions & 16 deletions test/reader.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,12 @@ describe('Reader', () => {

afterEach(() => tempFile.tearDown());

it('test Able to read from a file', () => {
it('Able to read from a file', () => {
givenTheProperties('some.property=Value');
expect(properties.get('some.property')).to.be('Value');
});

it('test Merges multiple files', () => {
it('Merges multiple files', () => {
givenTheProperties('some.property=Value');

tempFile('[section]\nsome.property=Another Value');
Expand All @@ -32,7 +32,7 @@ describe('Reader', () => {
expect(properties.get('some.property')).to.be('Value');
});

it('test Runs a function across all items in the reader', () => {
it('Runs a function across all items in the reader', () => {
givenTheProperties(
'a = 123\n' +
'b = true\n'
Expand All @@ -51,7 +51,7 @@ describe('Reader', () => {
}
});

it('test Attempts type coercion', () => {
it('Attempts type coercion', () => {
givenTheProperties(
'a = 123\n' +
'b = true\n' +
Expand All @@ -63,12 +63,12 @@ describe('Reader', () => {
expect(properties.get('d')).to.be(0.1);
});

it('test Correctly handles values that are nothing but whitespace', () => {
it('Correctly handles values that are nothing but whitespace', () => {
givenTheProperties('a = \n');
expect(properties.getRaw('a')).to.be('');
});

it('test Allows access to non-parsed values', () => {
it('Allows access to non-parsed values', () => {
givenTheProperties(`
a = 123
b = true
Expand All @@ -81,7 +81,7 @@ describe('Reader', () => {
expect(properties.getRaw('d')).to.be('0.1');
});

it('test Properties are trimmed when parsed', () => {
it('Properties are trimmed when parsed', () => {
givenTheProperties(`
some.property =Value
foo.bar = A Value`);
Expand All @@ -90,20 +90,20 @@ describe('Reader', () => {
expect(properties.get('foo.bar')).to.be('A Value');
});

it('test Blank lines are ignored', () => {
it('Blank lines are ignored', () => {
givenTheProperties('\n\nsome.property=Value\n\nfoo.bar = A Value');

expect(properties.length).to.be(2);
});

it('test Properties can be read back via their dot notation names', () => {
it('Properties can be read back via their dot notation names', () => {
givenTheProperties('\n\nsome.property=Value\n\nfoo.bar = A Value');

expect(properties.path().some.property).to.be('Value');
expect(properties.path().foo.bar).to.be('A Value');
});

it('test Sets properties into an app', () => {
it('Sets properties into an app', () => {
const app = {set: spy()};
givenTheProperties(`
some.property=Value
Expand All @@ -114,7 +114,7 @@ describe('Reader', () => {
expect(app.set.withArgs('foo.bar', 'A Value').calledOnce).to.be.ok();
});

it('test Permits escaped new line characters', () => {
it('Permits escaped new line characters', () => {
givenTheProperties('\n\nsome.property= Multi\\n Line \\nString \nfoo.bar = A Value');

// parsed access modifies the new line characters
Expand All @@ -126,15 +126,15 @@ describe('Reader', () => {
expect(properties.path().some.property).to.be('Multi\\n Line \\nString');
});

it('test Returns null when getting a missing property', () => {
it('Returns null when getting a missing property', () => {
givenTheProperties('prop = value');

// parsed access modifies the new line characters
expect(properties.get('prop')).to.be('value');
expect(properties.get('missing')).to.be(null);
});

it('test getByRoot when getting a bunch of objects', () => {
it('getByRoot when getting a bunch of objects', () => {
givenTheProperties(`
root.sect.a = 1
root.sect.b = bar
Expand All @@ -154,7 +154,7 @@ describe('Reader', () => {
);
});

it('test getByRoot when names are sub strings', () => {
it('getByRoot when names are sub strings', () => {
givenTheProperties(`
root.sect.a = 1
Expand All @@ -170,7 +170,7 @@ describe('Reader', () => {
});
});

it('test getAllProperties returns properties map', () => {
it('getAllProperties returns properties map', () => {
givenTheProperties(`
root.a.b = Hello
Expand All @@ -184,7 +184,7 @@ describe('Reader', () => {
});
});

it('test getAllProperties is immutable', () => {
it('getAllProperties is immutable', () => {
givenTheProperties(`
root.a.b = Hello
Expand Down
10 changes: 5 additions & 5 deletions test/section.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ describe('section', () => {

afterEach(() => tempFile.tearDown());

it('test Able to read URLs as part of a section', () => {
it('Able to read URLs as part of a section', () => {
givenTheProperties(`
[foo]
base.api.url=http://blah.com
Expand All @@ -33,7 +33,7 @@ thing = 123
expect(properties.get('another.thing')).to.be(123);
});

it('test Able to read file with sections that are already properties', () => {
it('Able to read file with sections that are already properties', () => {
givenTheProperties(`
some = thing
section = value
Expand All @@ -47,7 +47,7 @@ thing = 123
expect(properties.path().section).to.eql({'': 'value', 'sub': 'property'});
});

it('test Ignores comment blocks', () => {
it('Ignores comment blocks', () => {
givenTheProperties(`
some = thing
Expand All @@ -60,7 +60,7 @@ thing = 123
expect(properties.get('section')).to.be('another value');
});

it('test Able to read from a file with sections', () => {
it('Able to read from a file with sections', () => {
givenTheProperties(`
some.property = Value
Expand All @@ -77,7 +77,7 @@ thing = 123
expect(properties.path().blah.another.property).to.be('Something Else');
});

it('test Able use section names with white space', () => {
it('Able use section names with white space', () => {
givenTheProperties(`
some.property = Value
Expand Down
12 changes: 6 additions & 6 deletions test/writer.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ describe('writer', () => {

afterEach(() => tempFile.tearDown());

it('test Able to stringify properties', () => {
it('Able to stringify properties', () => {
givenTheProperties(`
property = Value
`);
Expand All @@ -26,7 +26,7 @@ describe('writer', () => {
expect(propertiesStringsArray).to.eql(['property=Value']);
});

it('test Able to stringify properties with section', () => {
it('Able to stringify properties with section', () => {
givenTheProperties(`
[main]
property=Value
Expand All @@ -37,7 +37,7 @@ describe('writer', () => {
expect(propertiesStringsArray).to.eql(['[main]', 'property=Value']);
});

it( 'test Able to stringify properties with the few sections', () => {
it( 'Able to stringify properties with the few sections', () => {
const inputContent = `
property1=Value1
Expand All @@ -59,22 +59,22 @@ property4=Value4
expect(propertiesStringsArray).to.eql(inputContent.trim().split('\n').filter(Boolean));
});

it( 'test Able to stringify properties after set', () => {
it( 'Able to stringify properties after set', () => {
givenTheProperties('property=Value');

properties.set('property', 'xxx');

expect(properties._stringifyProperties()).to.eql(['property=xxx']);
});

it( 'test Able to stringify properties after set with sections', () => {
it( 'Able to stringify properties after set with sections', () => {
givenTheProperties('[main]\nproperty=Value');

properties.set('main.property', 'xxx');
expect(properties._stringifyProperties()).to.eql(['[main]', 'property=xxx']);
});

it( 'test Able to stringify properties after set with sections and dots', () => {
it( 'Able to stringify properties after set with sections and dots', () => {
givenTheProperties('[main]\nproperty.one=Value');

properties.set('main.property.one', 'xxx');
Expand Down

0 comments on commit 8899022

Please sign in to comment.