Add base for unit test.

This commit is contained in:
Glenn Y. Rolland 2015-08-10 16:58:34 +02:00
parent 282753aa6e
commit 019f1fb529
9 changed files with 75 additions and 19 deletions

View file

@ -105,7 +105,7 @@ end
Rake::TestTask.new do |t|
#t.warning = true
#t.verbose = true
t.verbose = true
t.libs << "spec"
t.test_files = FileList['spec/**/*_spec.rb']
end

View file

@ -1,5 +0,0 @@
module Qasim
APP_NAME = "Qasim"
APP_VERSION = "0.1.11"
APP_DATE = "2014-05-09"
end

View file

@ -1,15 +1,39 @@
require_relative 'spec_helper'
require 'minitest'
require 'pry'
require 'qasim/cli'
describe Qasim::CLI do
let(:cli) { Qasim::CLI.new }
describe Qasim::Cli do
let(:cli) { Qasim::Cli.new }
describe '.new' do
it "can be created without arguments" do
assert_instance_of Qasim::CLI, cli
end
end
describe '.new' do
it "can be created without arguments" do
skip "Later" #assert_instance_of Qasim::Cli, cli
end
end
describe '.list' do
it "must exist" do
assert_respond_to cli, :list
end
it "must show existing maps" do
skip "Add map. List maps. Verify added map exists"
end
end
describe '.add' do
it "must exist" do
assert_respond_to cli, :add
end
end
describe '.del' do
it "must exist" do
assert_respond_to cli, :del
end
end
end

7
spec/config_spec.rb Normal file
View file

@ -0,0 +1,7 @@
require_relative 'spec_helper'
require 'qasim/config'
describe Qasim::Config do
# something
end

7
spec/constants_spec.rb Normal file
View file

@ -0,0 +1,7 @@
require_relative 'spec_helper'
require 'qasim/config'
describe Qasim::Config do
# something
end

7
spec/map_spec.rb Normal file
View file

@ -0,0 +1,7 @@
require_relative 'spec_helper'
require 'qasim/map'
describe Qasim::Config do
# something
end

7
spec/map_ssh_spec.rb Normal file
View file

@ -0,0 +1,7 @@
require_relative 'spec_helper'
require 'qasim/map_ssh'
describe Qasim::Config do
# something
end

View file

@ -1,14 +1,16 @@
#require 'mark'
#
require 'simplecov'
SimpleCov.start do
add_filter { |src| src.filename.match(/_spec\.rb$/) }
end
require 'minitest'
require 'minitest/unit'
require 'minitest/autorun'
require 'minitest/spec'
require 'minitest/pride'
require 'pry'
$LOAD_PATH.unshift('../lib')
#if __FILE__ == $0
# $LOAD_PATH.unshift('lib', 'spec')
# Dir.glob('./spec/**/*_spec.rb') { |f| require f }
#end

7
spec/ui_spec.rb Normal file
View file

@ -0,0 +1,7 @@
require_relative 'spec_helper'
require 'qasim/ui'
describe Qasim::Config do
# something
end