ztk 1.0.0.rc.0 → 1.0.0.rc.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -24,42 +24,12 @@ describe ZTK::TCPSocketCheck do
24
24
 
25
25
  subject { ZTK::TCPSocketCheck.new }
26
26
 
27
- before(:all) do
28
- $stdout = File.open("/dev/null", "w")
29
- $stderr = File.open("/dev/null", "w")
30
- $stdin = File.open("/dev/null", "r")
31
- end
32
-
33
27
  describe "class" do
34
28
 
35
29
  it "should be an instance of ZTK::TCPSocketCheck" do
36
30
  subject.should be_an_instance_of ZTK::TCPSocketCheck
37
31
  end
38
32
 
39
- describe "default config" do
40
-
41
- it "should use $stdout as the default" do
42
- subject.config.stdout.should be_a_kind_of $stdout.class
43
- subject.config.stdout.should == $stdout
44
- end
45
-
46
- it "should use $stderr as the default" do
47
- subject.config.stderr.should be_a_kind_of $stderr.class
48
- subject.config.stderr.should == $stderr
49
- end
50
-
51
- it "should use $stdin as the default" do
52
- subject.config.stdin.should be_a_kind_of $stdin.class
53
- subject.config.stdin.should == $stdin
54
- end
55
-
56
- it "should use $logger as the default" do
57
- subject.config.logger.should be_a_kind_of ZTK::Logger
58
- subject.config.logger.should == $logger
59
- end
60
-
61
- end
62
-
63
33
  describe "config" do
64
34
 
65
35
  it "should throw an exception if the host is not specified" do
@@ -24,12 +24,6 @@ describe ZTK::Template do
24
24
 
25
25
  subject { ZTK::Template }
26
26
 
27
- before(:all) do
28
- $stdout = File.open("/dev/null", "w")
29
- $stderr = File.open("/dev/null", "w")
30
- $stdin = File.open("/dev/null", "r")
31
- end
32
-
33
27
  describe "class" do
34
28
 
35
29
  it "should be ZTK::Template" do
@@ -0,0 +1,70 @@
1
+ ################################################################################
2
+ #
3
+ # Author: Zachary Patten <zachary@jovelabs.net>
4
+ # Copyright: Copyright (c) Jove Labs
5
+ # License: Apache License, Version 2.0
6
+ #
7
+ # Licensed under the Apache License, Version 2.0 (the "License");
8
+ # you may not use this file except in compliance with the License.
9
+ # You may obtain a copy of the License at
10
+ #
11
+ # http://www.apache.org/licenses/LICENSE-2.0
12
+ #
13
+ # Unless required by applicable law or agreed to in writing, software
14
+ # distributed under the License is distributed on an "AS IS" BASIS,
15
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16
+ # See the License for the specific language governing permissions and
17
+ # limitations under the License.
18
+ #
19
+ ################################################################################
20
+
21
+ require "spec_helper"
22
+
23
+ describe ZTK::UI do
24
+
25
+ subject { ZTK::UI.new }
26
+
27
+ describe "class" do
28
+
29
+ it "should be ZTK::UI" do
30
+ subject.should be_an_instance_of ZTK::UI
31
+ end
32
+
33
+ end
34
+
35
+ describe "behaviour" do
36
+
37
+ it "should return a class with accessors for stdout, stderr, stdin and a logger" do
38
+ subject.stdout.should == $stdout
39
+ subject.stderr.should == $stderr
40
+ subject.stdin.should == $stdin
41
+ subject.logger.should be_an_instance_of ZTK::Logger
42
+ end
43
+
44
+ it "should allow us to set a custom STDOUT" do
45
+ stdout = StringIO.new
46
+ ui = ZTK::UI.new(:stdout => stdout)
47
+ ui.stdout.should == stdout
48
+ end
49
+
50
+ it "should allow us to set a custom STDERR" do
51
+ stderr = StringIO.new
52
+ ui = ZTK::UI.new(:stderr => stderr)
53
+ ui.stderr.should == stderr
54
+ end
55
+
56
+ it "should allow us to set a custom STDIN" do
57
+ stdin = StringIO.new
58
+ ui = ZTK::UI.new(:stdin => stdin)
59
+ ui.stdin.should == stdin
60
+ end
61
+
62
+ it "should allow us to set a custom LOGGER" do
63
+ logger = StringIO.new
64
+ ui = ZTK::UI.new(:logger => logger)
65
+ ui.logger.should == logger
66
+ end
67
+
68
+ end
69
+
70
+ end
@@ -0,0 +1,39 @@
1
+ ################################################################################
2
+ #
3
+ # Author: Zachary Patten <zachary@jovelabs.net>
4
+ # Copyright: Copyright (c) Jove Labs
5
+ # License: Apache License, Version 2.0
6
+ #
7
+ # Licensed under the Apache License, Version 2.0 (the "License");
8
+ # you may not use this file except in compliance with the License.
9
+ # You may obtain a copy of the License at
10
+ #
11
+ # http://www.apache.org/licenses/LICENSE-2.0
12
+ #
13
+ # Unless required by applicable law or agreed to in writing, software
14
+ # distributed under the License is distributed on an "AS IS" BASIS,
15
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16
+ # See the License for the specific language governing permissions and
17
+ # limitations under the License.
18
+ #
19
+ ################################################################################
20
+
21
+ require "spec_helper"
22
+
23
+ describe "ZTK::VERSION" do
24
+
25
+ subject { ZTK::VERSION }
26
+
27
+ describe "object" do
28
+
29
+ it "should be defined as a constant" do
30
+ defined?(ZTK::VERSION).should == "constant"
31
+ end
32
+
33
+ it "should be a string" do
34
+ subject.is_a?(String).should == true
35
+ end
36
+
37
+ end
38
+
39
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ztk
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0.rc.0
4
+ version: 1.0.0.rc.1
5
5
  prerelease: 6
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-01-28 00:00:00.000000000 Z
12
+ date: 2013-02-03 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: erubis
@@ -233,6 +233,8 @@ files:
233
233
  - spec/ztk/ssh_spec.rb
234
234
  - spec/ztk/tcp_socket_check_spec.rb
235
235
  - spec/ztk/template_spec.rb
236
+ - spec/ztk/ui_spec.rb
237
+ - spec/ztk/version_spec.rb
236
238
  - ztk.gemspec
237
239
  homepage: https://github.com/jovelabs/ztk
238
240
  licenses: []
@@ -248,7 +250,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
248
250
  version: '0'
249
251
  segments:
250
252
  - 0
251
- hash: -2271608271036724635
253
+ hash: -276404012806695172
252
254
  required_rubygems_version: !ruby/object:Gem::Requirement
253
255
  none: false
254
256
  requirements:
@@ -278,4 +280,6 @@ test_files:
278
280
  - spec/ztk/ssh_spec.rb
279
281
  - spec/ztk/tcp_socket_check_spec.rb
280
282
  - spec/ztk/template_spec.rb
283
+ - spec/ztk/ui_spec.rb
284
+ - spec/ztk/version_spec.rb
281
285
  has_rdoc: