chekku 0.0.2 → 0.0.3

Sign up to get free protection for your applications and to get access to all the features.
data/lib/chekku/dsl.rb CHANGED
@@ -10,7 +10,7 @@ class Chekku::Dsl < Thor::Group
10
10
  end
11
11
 
12
12
  def check(name, version = nil, args ={})
13
- Chekku::GenericChecker.new(name, version, args).chekku!
13
+ say Chekku::GenericChecker.new(name, version, args).chekku!
14
14
  end
15
15
 
16
16
  def read_file(file)
@@ -8,9 +8,9 @@ class Chekku::GenericChecker < Thor::Shell::Basic
8
8
 
9
9
  def chekku!
10
10
  if which_exists?
11
- puts "\e[32m#{@name} exists!\e[0m"
11
+ "\e[32m#{@name} exists!\e[0m"
12
12
  else
13
- puts "\e[31mI think you must install #{@name}\e[0m"
13
+ "\e[31mI think you must install #{@name}\e[0m"
14
14
  end
15
15
  end
16
16
 
@@ -1,3 +1,3 @@
1
1
  module Chekku
2
- VERSION = '0.0.2'
2
+ VERSION = '0.0.3'
3
3
  end
@@ -0,0 +1,21 @@
1
+ require 'thor'
2
+ require 'chekku/generic_checker'
3
+
4
+ describe Chekku::GenericChecker do
5
+
6
+ context "The command exists" do
7
+ let(:valid_checker) { Chekku::GenericChecker.new('ls', nil, nil) }
8
+ it "should return a green string" do
9
+ valid_checker.chekku!.should == "\e[32mls exists!\e[0m"
10
+ end
11
+ end
12
+
13
+ context "The command does not exist" do
14
+ let(:invalid_checker) { Chekku::GenericChecker.new('lsdahpdahiofaiofhaoigfhoaugzza', nil, nil) }
15
+ it "should return a green string" do
16
+ invalid_checker.chekku!.should == "\e[31mI think you must install lsdahpdahiofaiofhaoigfhoaugzza\e[0m"
17
+ end
18
+ end
19
+
20
+
21
+ end
@@ -0,0 +1,8 @@
1
+ require 'rubygems'
2
+ require 'bundler/setup'
3
+
4
+ require 'chekku'
5
+
6
+ RSpec.configure do |config|
7
+ # some (optional) config here
8
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: chekku
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.3
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -64,6 +64,8 @@ files:
64
64
  - lib/chekku/dsl.rb
65
65
  - lib/chekku/generic_checker.rb
66
66
  - lib/chekku/version.rb
67
+ - spec/generic_checker_spec.rb
68
+ - spec/spec_helper.rb
67
69
  homepage: http://ys.github.com/chekku
68
70
  licenses: []
69
71
  post_install_message:
@@ -88,4 +90,6 @@ rubygems_version: 1.8.23
88
90
  signing_key:
89
91
  specification_version: 3
90
92
  summary: ! 'Chekku: software dependencies checker'
91
- test_files: []
93
+ test_files:
94
+ - spec/generic_checker_spec.rb
95
+ - spec/spec_helper.rb