Permalink
Browse files

Add very basic unit test

  • Loading branch information...
koenrh committed Oct 23, 2016
1 parent 6e5731d commit 53a6e958cbc048e9be526ba979d8dc97b1d8bf1d
Showing with 64 additions and 1 deletion.
  1. +9 −0 Gemfile
  2. +19 −1 Gemfile.lock
  3. +8 −0 Rakefile
  4. +25 −0 test/plugins/aws_access_token_test.rb
  5. +3 −0 test/test_helper.rb
View
@@ -6,3 +6,12 @@ gem 'require_all'
gem 'tty'
gem 'http'
gem 'nokogiri'
group :test do
gem 'minitest'
gem 'rake'
end
group :development do
gem 'rubocop'
end
View
@@ -2,6 +2,7 @@ GEM
remote: https://rubygems.org/
specs:
addressable (2.4.0)
ast (2.3.0)
coderay (1.1.1)
domain_name (0.5.20160615)
unf (>= 0.0.5, < 1.0.0)
@@ -17,19 +18,32 @@ GEM
http_parser.rb (0.6.0)
method_source (0.8.2)
mini_portile2 (2.1.0)
minitest (5.9.1)
necromancer (0.3.0)
nokogiri (1.6.8)
mini_portile2 (~> 2.1.0)
pkg-config (~> 1.1.7)
parser (2.3.1.4)
ast (~> 2.2)
pastel (0.6.1)
equatable (~> 0.5.0)
tty-color (~> 0.3.0)
pkg-config (1.1.7)
powerpack (0.1.1)
pry (0.10.4)
coderay (~> 1.1.0)
method_source (~> 0.8.1)
slop (~> 3.4)
rainbow (2.1.0)
rake (11.3.0)
require_all (1.3.3)
rubocop (0.43.0)
parser (>= 2.3.1.1, < 3.0)
powerpack (~> 0.1)
rainbow (>= 1.99.1, < 3.0)
ruby-progressbar (~> 1.7)
unicode-display_width (~> 1.0, >= 1.0.1)
ruby-progressbar (1.8.1)
slop (3.6.0)
tty (0.5.0)
equatable (~> 0.5.0)
@@ -75,6 +89,7 @@ GEM
unf (0.1.4)
unf_ext
unf_ext (0.0.7.2)
unicode-display_width (1.1.1)
unicode_utils (1.4.0)
verse (0.4.0)
unicode_utils (~> 1.4.0)
@@ -85,10 +100,13 @@ PLATFORMS
DEPENDENCIES
http
minitest
nokogiri
pry
rake
require_all
rubocop
tty
BUNDLED WITH
1.12.5
1.13.6
View
@@ -0,0 +1,8 @@
# frozen_string_literal: true
require 'rake/testtask'
Rake::TestTask.new(:test) do |t|
t.pattern = 'test/**/*_test.rb'
end
task default: :test
@@ -0,0 +1,25 @@
require_relative '../test_helper'
require 'plugins/base_plugin'
require 'plugins/aws_access_token'
describe Vcsmap::Plugin::AwsAccessToken do
let(:plugin) { Vcsmap::Plugin::AwsAccessToken.new }
let(:file) do
<<-eos
[contoso]
aws_access_key_id = AKIAED8B369A90EDAB2A
aws_secret_access_key = EAB37ae33174B8A2B0f0/3798C78ca26EAB37AE3
eos
end
describe '#capture_match' do
it 'must return the matched AWS key pair' do
credentials = plugin.credentials(file)
expected = ['AKIAED8B369A90EDAB2A', 'EAB37ae33174B8A2B0f0/3798C78ca26EAB37AE3']
credentials.must_equal expected
end
end
end
View
@@ -0,0 +1,3 @@
$LOAD_PATH.unshift File.expand_path('../lib', __FILE__)
require 'minitest/autorun'

0 comments on commit 53a6e95

Please sign in to comment.