@snyk/gemfile 1.2.0 → 1.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,85 +0,0 @@
1
- GIT
2
- remote: https://github.com/rspec/rspec.git
3
- revision: bc209d4a2a2dfbf38ac1d470b213753aa9e654db
4
- specs:
5
- rspec (3.6.0.beta1)
6
- rspec-core (= 3.6.0.beta1)
7
- rspec-expectations (= 3.6.0.beta1)
8
- rspec-mocks (= 3.6.0.beta1)
9
-
10
- GIT
11
- remote: https://github.com/sparklemotion/nokogiri.git
12
- revision: 7f8b7b2bf55829e02cd11c2eb25814c3ed458676
13
- specs:
14
- nokogiri (1.0.0)
15
-
16
- GEM
17
- remote: https://rubygems.org/
18
- specs:
19
- activemodel (5.0.0.1)
20
- activesupport (= 5.0.0.1)
21
- activerecord (5.0.0.1)
22
- activemodel (= 5.0.0.1)
23
- activesupport (= 5.0.0.1)
24
- arel (~> 7.0)
25
- activesupport (5.0.0.1)
26
- concurrent-ruby (~> 1.0, >= 1.0.2)
27
- i18n (~> 0.7)
28
- minitest (~> 5.1)
29
- tzinfo (~> 1.1)
30
- arel (7.1.4)
31
- concurrent-ruby (1.0.2)
32
- diff-lcs (1.2.5)
33
- fastreader (1.0.8)
34
- activerecord (>= 2.0.0)
35
- activesupport (>= 2.0.0)
36
- feed-normalizer (>= 1.5.1)
37
- highline (>= 1.4.0)
38
- hoe (>= 1.6.0)
39
- hpricot (>= 0.6)
40
- simple-rss (>= 1.1)
41
- sqlite3-ruby (>= 1.2.2)
42
- feed-normalizer (1.5.2)
43
- hpricot (>= 0.6)
44
- simple-rss (>= 1.1)
45
- highline (1.7.8)
46
- hoe (3.15.2)
47
- rake (>= 0.8, < 12.0)
48
- hpricot (0.8.6)
49
- i18n (0.7.0)
50
- minitest (5.9.1)
51
- pdfkit (0.5.2)
52
- rack (1.6.4)
53
- rake (11.3.0)
54
- rspec-core (3.6.0.beta1)
55
- rspec-support (= 3.6.0.beta1)
56
- rspec-expectations (3.6.0.beta1)
57
- diff-lcs (>= 1.2.0, < 2.0)
58
- rspec-support (= 3.6.0.beta1)
59
- rspec-mocks (3.6.0.beta1)
60
- diff-lcs (>= 1.2.0, < 2.0)
61
- rspec-support (= 3.6.0.beta1)
62
- rspec-support (3.6.0.beta1)
63
- simple-rss (1.3.1)
64
- sqlite3 (1.3.12)
65
- sqlite3-ruby (1.3.3)
66
- sqlite3 (>= 1.3.3)
67
- thread_safe (0.3.5)
68
- tzinfo (1.2.2)
69
- thread_safe (~> 0.1)
70
-
71
- PLATFORMS
72
- ruby
73
-
74
- DEPENDENCIES
75
- fastreader
76
- nokogiri (= 1.0.0)!
77
- pdfkit (~> 0.5)
78
- rack (~> 1.1)
79
- rspec!
80
-
81
- BUNDLED WITH
82
- 1.13.6
83
-
84
- RUBY VERSION
85
- ruby 2.3.1p0 (jruby 9.1.6.0)
@@ -1,169 +0,0 @@
1
- 'use strict';
2
-
3
- let fs = require('fs');
4
- let assert = require('chai').assert;
5
- let sinon = require('sinon');
6
- let gemfile = require('../gemfile');
7
- let file = fs.readFileSync('test/Gemfile.lock', 'utf8');
8
-
9
- describe('gemfile', function() {
10
- describe('interpret', function() {
11
- it('throws when given an argument that isn\'t a String', function() {
12
- assert.throws(function() {
13
- gemfile.interpret([]);
14
- });
15
- });
16
-
17
- it('warns when the input doesn\'t look like a Gemfile.lock', function() {
18
- let warn = sinon.stub(console, 'warn');
19
-
20
- gemfile.interpret('hello');
21
-
22
- assert.isTrue(warn.called);
23
- assert.isTrue(warn.calledWithMatch(/^Are you sure/));
24
-
25
- warn.reset();
26
- });
27
-
28
- describe('reads a Gemfile.lock', function() {
29
- it('outputs a JavaScript Object', function() {
30
- assert.isObject(
31
- gemfile.interpret(file)
32
- );
33
- });
34
-
35
- it('outputs an Object with three mandatory keys', function() {
36
- let output = gemfile.interpret(file);
37
-
38
- assert.property(output, 'GEM');
39
- assert.property(output, 'DEPENDENCIES');
40
- assert.property(output, 'PLATFORMS');
41
- });
42
-
43
- it('adjusts "BUNDLED WITH" by changing it to a String indicating version', function() {
44
- let output = gemfile.interpret(file);
45
- assert.property(output, 'BUNDLED WITH');
46
- assert.match(output['BUNDLED WITH'], /\d{1,3}\.\d{1,3}\.\d{1,3}/);
47
- });
48
-
49
- describe('identifies', function() {
50
- it('paths', function() {
51
- assert.deepEqual(
52
- gemfile.interpret('test: some/path'),
53
- {test: {path: 'some/path'}}
54
- );
55
- });
56
-
57
- it('versions', function() {
58
- assert.deepEqual(
59
- gemfile.interpret('test (1.0.0)'),
60
- {test: {version: '1.0.0'}}
61
- );
62
- });
63
-
64
- it('outsourced versions', function() {
65
- assert.deepEqual(
66
- gemfile.interpret('test (1.0.0)!'),
67
- {test: {version: '1.0.0', outsourced: true}}
68
- );
69
- });
70
-
71
- it('SHAs', function() {
72
- assert.deepEqual(
73
- gemfile.interpret('test: abcdefa'),
74
- {test: {sha: 'abcdefa'}}
75
- );
76
- });
77
- });
78
- });
79
- });
80
-
81
- describe('parseSync', function() {
82
- it('parses a Gemfile.lock with a default location', function() {
83
- assert.throws(function() {
84
- gemfile.parseSync();
85
- }, new RegExp(`${process.cwd()}\/Gemfile\.lock`));
86
- });
87
-
88
- it('throws if given location does not exist', function() {
89
- assert.throws(function() {
90
- gemfile.parseSync('this/is/made/up')
91
- });
92
- });
93
-
94
- it('parses a Gemfile.lock with a given location', function() {
95
- assert.isObject(
96
- gemfile.parseSync('./test/Gemfile.lock')
97
- );
98
- });
99
- });
100
-
101
- describe('parse', function() {
102
- it('parses a Gemfile.lock with a default location', function(done) {
103
- gemfile.parse().then(function() {
104
- done();
105
- }, function(error) {
106
- throw error;
107
- }, function() {
108
- }).catch(function() {
109
- assert.throws(function() {
110
- gemfile.parseSync();
111
- }, new RegExp(`${process.cwd()}\/Gemfile\.lock`));
112
- done();
113
- });
114
- });
115
-
116
- it('throws if given location does not exist', function(done) {
117
- gemfile.parse('this/is/made/up').then(function() {
118
- throw 'A file was loaded unexpected. Whaa? Magic, I guess.';
119
- }, function(error) {
120
- assert.match(error, /Couldn't find a Gemfile/);
121
- done();
122
- });
123
- });
124
-
125
- it('parses a Gemfile.lock with a given location', function(done) {
126
- gemfile.parse('./test/Gemfile.lock').then(function(data) {
127
- assert.isObject(data);
128
- done();
129
- }).catch(function(error) {
130
- throw error;
131
- });
132
- });
133
- });
134
-
135
- describe('meta analysis', function () {
136
- const file = fs.readFileSync('test/Gemfile2.lock', 'utf8');
137
- it('outputs an Object with three mandatory keys', function() {
138
- let output = gemfile.interpret(file);
139
-
140
- assert.property(output, 'GEM');
141
- assert.property(output, 'GIT');
142
- assert.property(output, 'DEPENDENCIES');
143
- assert.property(output, 'PLATFORMS');
144
- });
145
-
146
- it('has a good meta specs', function () {
147
- let output = gemfile.interpret(file, true);
148
- assert.property(output.specs, 'rspec');
149
- assert.property(output.specs, 'nokogiri');
150
- assert.property(output.specs, 'activemodel');
151
- });
152
-
153
- it('has actual metadata', function () {
154
- let output = gemfile.interpret(file, true);
155
- assert.deepEqual(output.rubyVersion, '2.3.1p0');
156
- assert.property(output.specs.rspec, 'revision');
157
- });
158
-
159
- ['Gemfile', 'Gemfile2'].forEach(function(filename) {
160
- it('returns exactly what we expect for ' + filename, function() {
161
- let file = fs.readFileSync('test/' + filename + '.lock', 'utf8');
162
- let expected = JSON.parse(
163
- fs.readFileSync('test/' + filename + '.json', 'utf8'));
164
- let output = gemfile.interpret(file, true);
165
- assert.deepEqual(output, expected, 'deep equals');
166
- });
167
- });
168
- });
169
- });