-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add support for metadata in file headers
Solves #10.
- Loading branch information
Rasmus Bengtsson
committed
Jun 3, 2017
1 parent
76bba6b
commit c46b8cb
Showing
6 changed files
with
94 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
/* eslint-env node, mocha */ | ||
/* global before, after, describe, it */ | ||
'use strict'; | ||
|
||
const assert = require('assert'); | ||
const wpPot = require('../'); | ||
const testHelper = require('./test-helper'); | ||
|
||
describe('File Headers tests', () => { | ||
it('Can read theme headers', () => { | ||
const fixturePath = 'test/fixtures/theme-headers.php'; | ||
|
||
const potContents = wpPot({ | ||
src: fixturePath, | ||
writeFile: false, | ||
metadataFile: fixturePath | ||
}); | ||
|
||
assert(testHelper.verifyLanguageBlock(potContents, false, fixturePath + ':2', 'Test Theme', false, false)); | ||
assert(testHelper.verifyLanguageBlock(potContents, false, fixturePath + ':3', 'Rasmus Bengtsson', false, false)); | ||
assert(testHelper.verifyLanguageBlock(potContents, false, fixturePath + ':4', '1.0.0', false, false)); | ||
}); | ||
|
||
it('Can read plugin headers', () => { | ||
const fixturePath = 'test/fixtures/plugin-headers.php'; | ||
|
||
const potContents = wpPot({ | ||
src: fixturePath, | ||
writeFile: false, | ||
metadataFile: fixturePath | ||
}); | ||
|
||
assert(testHelper.verifyLanguageBlock(potContents, false, fixturePath + ':2', 'Test Plugin', false, false)); | ||
assert(testHelper.verifyLanguageBlock(potContents, false, fixturePath + ':3', 'Rasmus Bengtsson', false, false)); | ||
assert(testHelper.verifyLanguageBlock(potContents, false, fixturePath + ':4', '1.0.0', false, false)); | ||
}); | ||
}); |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
<?php | ||
/* | ||
* Plugin Name: Test Plugin | ||
* Author: Rasmus Bengtsson | ||
* Version: 1.0.0 | ||
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
<?php | ||
/* | ||
* Theme Name: Test Theme | ||
* Author: Rasmus Bengtsson | ||
* Version: 1.0.0 | ||
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters