context_spook 1.5.0 → 1.5.1
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.
- checksums.yaml +4 -4
- data/context_spook.gemspec +2 -2
- data/lib/context_spook/generator.rb +3 -1
- data/lib/context_spook/version.rb +1 -1
- data/spec/context_spook/toon_spec.rb +9 -9
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 2bb51df13e01f4262026aea154cc901997a0b5cec6566f4bc71e42467ec3dfed
|
|
4
|
+
data.tar.gz: b26ead5c765e99a931026d267e6de374dc0c93f8a5c64e46bfe09c28d892dd99
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 4f8995fb526a7f6fd8be4c15c2a869775fdc5a826571bd84723689e695ca3b982325d56bf971da3982afc6cecdb2575d20d0319ea073d505d85e19a6415fdffc
|
|
7
|
+
data.tar.gz: 56bc054c3fe75f245ed97a7d92c0c91cb31dcfb1e7b101b2ee3a2092324a7290b7ec0449c5dba310b809a102e64d2bd40a656d126feef5a3d03ec588eaead314
|
data/context_spook.gemspec
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
# -*- encoding: utf-8 -*-
|
|
2
|
-
# stub: context_spook 1.5.
|
|
2
|
+
# stub: context_spook 1.5.1 ruby lib
|
|
3
3
|
|
|
4
4
|
Gem::Specification.new do |s|
|
|
5
5
|
s.name = "context_spook".freeze
|
|
6
|
-
s.version = "1.5.
|
|
6
|
+
s.version = "1.5.1".freeze
|
|
7
7
|
|
|
8
8
|
s.required_rubygems_version = Gem::Requirement.new(">= 0".freeze) if s.respond_to? :required_rubygems_version=
|
|
9
9
|
s.require_paths = ["lib".freeze]
|
|
@@ -272,7 +272,9 @@ module ContextSpook
|
|
|
272
272
|
# The commands method sets up a DSL accessor for provided command outputs.
|
|
273
273
|
#
|
|
274
274
|
# @param value [ Hash ] the hash of commands to be set
|
|
275
|
-
dsl_accessor :commands
|
|
275
|
+
dsl_accessor :commands do
|
|
276
|
+
{}
|
|
277
|
+
end
|
|
276
278
|
|
|
277
279
|
# The command method executes a shell command and stores its result.
|
|
278
280
|
#
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
require 'spec_helper'
|
|
2
2
|
|
|
3
3
|
describe ContextSpook::TOON do
|
|
4
|
-
let(:
|
|
4
|
+
let(:my_context) do
|
|
5
5
|
ContextSpook.generate_context do
|
|
6
6
|
context do
|
|
7
7
|
variable foo: 'bar'
|
|
@@ -13,13 +13,13 @@ describe ContextSpook::TOON do
|
|
|
13
13
|
|
|
14
14
|
describe '#to_toon' do
|
|
15
15
|
it 'converts context to TOON format' do
|
|
16
|
-
toon_output =
|
|
16
|
+
toon_output = my_context.to_toon
|
|
17
17
|
expect(toon_output).to be_a(String)
|
|
18
18
|
expect(toon_output).to_not be_empty
|
|
19
19
|
end
|
|
20
20
|
|
|
21
21
|
it 'produces valid TOON output' do
|
|
22
|
-
toon_output =
|
|
22
|
+
toon_output = my_context.to_toon
|
|
23
23
|
expect(toon_output).to match(
|
|
24
24
|
%r{
|
|
25
25
|
\Afiles:\n
|
|
@@ -41,26 +41,26 @@ describe ContextSpook::TOON do
|
|
|
41
41
|
|
|
42
42
|
describe '#toon_size' do
|
|
43
43
|
it 'returns the size of TOON representation in bytes' do
|
|
44
|
-
size =
|
|
44
|
+
size = my_context.toon_size
|
|
45
45
|
expect(size).to be_a(Integer)
|
|
46
46
|
expect(size).to be > 0
|
|
47
47
|
end
|
|
48
48
|
|
|
49
49
|
it 'matches the size of the TOON output' do
|
|
50
|
-
size =
|
|
51
|
-
toon_output =
|
|
50
|
+
size = my_context.toon_size
|
|
51
|
+
toon_output = my_context.to_toon
|
|
52
52
|
expect(size).to eq(toon_output.size)
|
|
53
53
|
end
|
|
54
54
|
end
|
|
55
55
|
|
|
56
56
|
describe 'integration with ContextSpook::Generator::Context' do
|
|
57
57
|
it 'is included in Context class' do
|
|
58
|
-
expect(
|
|
59
|
-
expect(
|
|
58
|
+
expect(my_context).to respond_to(:to_toon)
|
|
59
|
+
expect(my_context).to respond_to(:toon_size)
|
|
60
60
|
end
|
|
61
61
|
|
|
62
62
|
it 'works with context data' do
|
|
63
|
-
toon_output =
|
|
63
|
+
toon_output = my_context.to_toon
|
|
64
64
|
expect(toon_output).to include('variables:')
|
|
65
65
|
expect(toon_output).to include('metadata:')
|
|
66
66
|
expect(toon_output).to include('files:')
|