forked from badges/shields
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgithub-r-package.spec.js
More file actions
30 lines (26 loc) · 893 Bytes
/
Copy pathgithub-r-package.spec.js
File metadata and controls
30 lines (26 loc) · 893 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
'use strict'
const { expect } = require('chai')
const { test, given } = require('sazerac')
const { InvalidResponse } = require('..')
const GithubRPackageVersion = require('./github-r-package.service')
describe('GithubRPackageVersion', function () {
const content = versionLine =>
[
'Package: mypackage',
'Title: What The Package Does (one line, title case required)',
versionLine,
'',
].join('\n')
test(GithubRPackageVersion.transform, () => {
given(content('Version: 6.10.9'), 'DESCRIPTION').expect({
version: '6.10.9',
})
})
it('throws InvalidResponse if a file does not contain version specification', function () {
expect(() =>
GithubRPackageVersion.transform(content('Versio: 6.10.9'), 'DESCRIPTION')
)
.to.throw(InvalidResponse)
.with.property('prettyMessage', 'Version missing in DESCRIPTION')
})
})