train 0.14.0 → 0.14.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: bef369edee3db008a24f018851fb38b4b8ee2690
4
- data.tar.gz: 4a029b67d3631b3975ad928c1b7c7832ac7da2cf
3
+ metadata.gz: d2865a5d40c9667e2265f443b730066ddd6357c0
4
+ data.tar.gz: 6dc89468235414f6213c7e1798fb371b0f3af923
5
5
  SHA512:
6
- metadata.gz: 81d4f61c914a1b3cbdfc11037c90be5652d3a7a8264d8ba351c65e614036a71bb507339ea6bfec310098b65a261b831d0ca97e517bd86dde5d286fae4cc9d466
7
- data.tar.gz: c8d5bddc212d56e7d7f604df95008339b676c8dcf59a7dc59c7422d997d23781adce45276db983184a7c4b659282b98bd1d3b6f50b7434444fca12dfb7d8e7c0
6
+ metadata.gz: f38a9a6c3b0246ce8965956c67649e788c4a20abce3545380ee37d8f607d856fff1113e736dc49e62816d55781aed7c87a96fc8810a658d078acf1ca2699ac55
7
+ data.tar.gz: d9d479807beee1ac63dbcc50cefb4580c3586c96cd2422d0ac3a0cfd5d70d14cc4e6457483f10ba4a869fa8adb090a53ef654948b19343058388fb6e43af0e37
@@ -1,7 +1,14 @@
1
1
  # Change Log
2
2
 
3
- ## [0.14.0](https://github.com/chef/train/tree/0.14.0) (2016-06-27)
4
- [Full Changelog](https://github.com/chef/train/compare/v0.13.1...0.14.0)
3
+ ## [0.14.1](https://github.com/chef/train/tree/0.14.1) (2016-06-27)
4
+ [Full Changelog](https://github.com/chef/train/compare/v0.14.0...0.14.1)
5
+
6
+ **Fixed bugs:**
7
+
8
+ - bugfix: add mock backend initialization [\#119](https://github.com/chef/train/pull/119) ([arlimus](https://github.com/arlimus))
9
+
10
+ ## [v0.14.0](https://github.com/chef/train/tree/v0.14.0) (2016-06-27)
11
+ [Full Changelog](https://github.com/chef/train/compare/v0.13.1...v0.14.0)
5
12
 
6
13
  **Implemented enhancements:**
7
14
 
@@ -14,12 +21,18 @@
14
21
  - bugfix: run frozen string commands via ssh [\#117](https://github.com/chef/train/pull/117) ([arlimus](https://github.com/arlimus))
15
22
 
16
23
  ## [v0.13.1](https://github.com/chef/train/tree/v0.13.1) (2016-06-16)
17
- [Full Changelog](https://github.com/chef/train/compare/v0.12.1...v0.13.1)
24
+ [Full Changelog](https://github.com/chef/train/compare/v0.13.0...v0.13.1)
18
25
 
19
26
  **Implemented enhancements:**
20
27
 
21
28
  - have net-ssh request a pty [\#60](https://github.com/chef/train/issues/60)
22
29
  - use train as gem name. Thanks @halo [\#115](https://github.com/chef/train/pull/115) ([chris-rock](https://github.com/chris-rock))
30
+
31
+ ## [v0.13.0](https://github.com/chef/train/tree/v0.13.0) (2016-06-16)
32
+ [Full Changelog](https://github.com/chef/train/compare/v0.12.1...v0.13.0)
33
+
34
+ **Implemented enhancements:**
35
+
23
36
  - provide uri-formatted information on all connections [\#113](https://github.com/chef/train/pull/113) ([arlimus](https://github.com/arlimus))
24
37
 
25
38
  **Fixed bugs:**
@@ -64,7 +64,7 @@ class Train::Transports::Mock
64
64
  attr_reader :os
65
65
 
66
66
  def initialize(conf = nil)
67
- @conf = conf || {}
67
+ super(conf)
68
68
  @os = OS.new(self, family: 'unknown')
69
69
  @commands = {}
70
70
  end
@@ -82,7 +82,7 @@ class Train::Transports::Mock
82
82
  end
83
83
 
84
84
  def command_not_found(cmd)
85
- if @conf[:verbose]
85
+ if @options[:verbose]
86
86
  STDERR.puts('Command not mocked:')
87
87
  STDERR.puts(' '+cmd.to_s.split("\n").join("\n "))
88
88
  STDERR.puts(' SHA: ' + Digest::SHA256.hexdigest(cmd.to_s))
@@ -97,7 +97,7 @@ class Train::Transports::Mock
97
97
  end
98
98
 
99
99
  def file_not_found(path)
100
- STDERR.puts('File not mocked: '+path.to_s) if @conf[:verbose]
100
+ STDERR.puts('File not mocked: '+path.to_s) if @options[:verbose]
101
101
  File.new(self, path)
102
102
  end
103
103
 
@@ -3,5 +3,5 @@
3
3
  # Author:: Dominik Richter (<dominik.richter@gmail.com>)
4
4
 
5
5
  module Train
6
- VERSION = '0.14.0'.freeze
6
+ VERSION = '0.14.1'.freeze
7
7
  end
@@ -84,11 +84,18 @@ describe 'mock transport' do
84
84
  end
85
85
 
86
86
  describe 'when accessing a mocked file' do
87
- JSON = Train.create('local').connection.file(__FILE__).to_json
88
- RES = Train::Transports::Mock::Connection::File.from_json(JSON)
87
+ it 'handles a non-existing file' do
88
+ x = rand.to_s
89
+ f = connection.file(x)
90
+ f.must_be_kind_of Train::Transports::Mock::Connection::File
91
+ f.exist?.must_equal false
92
+ f.path.must_equal x
93
+ end
89
94
 
90
95
  # tests if all fields between the local json and resulting mock file
91
96
  # are equal
97
+ JSON = Train.create('local').connection.file(__FILE__).to_json
98
+ RES = Train::Transports::Mock::Connection::File.from_json(JSON)
92
99
  %w{ content mode owner group }.each do |f|
93
100
  it "can be initialized from json (field #{f})" do
94
101
  RES.method(f).call.must_equal JSON[f]
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: train
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.14.0
4
+ version: 0.14.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dominik Richter
@@ -162,6 +162,7 @@ files:
162
162
  - lib/train/plugins.rb
163
163
  - lib/train/plugins/base_connection.rb
164
164
  - lib/train/plugins/transport.rb
165
+ - lib/train/transports/.mock.rb.swp
165
166
  - lib/train/transports/docker.rb
166
167
  - lib/train/transports/local.rb
167
168
  - lib/train/transports/local_file.rb