Skip to content

Commit 76d35f0

Browse files
committed
change name to tf, bump version to 0.3.0
1 parent d1f1ad7 commit 76d35f0

25 files changed

+78
-70
lines changed

.gitignore

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
.idea
2-
dtf-*.gem
2+
tf-*.gem
33
Gemfile.lock

.travis.yml

+1-3
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,12 @@ rvm:
77
- rbx-19mode
88
- jruby-18mode
99
- jruby-19mode
10-
script: 'bin/dtf_test test/*/*.rb'
10+
script: 'bin/tf_test test/*/*.rb'
1111
notifications:
1212
irc:
1313
channels:
1414
- "irc.freenode.org#rvm-test"
15-
- "irc.freenode.org#dtf-gems"
1615
email:
1716
recipients:
1817
19-
2018
on_failure: change

CHANGELOG.md

+6-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
# Changelog
22

3+
## 0.3.0
4+
date: 2012-05-28
5+
6+
- rename to tf
7+
38
## 0.2.0
49
date: 2012-03-28
510

@@ -21,7 +26,7 @@ date: 2012-02-02
2126
date: 2012-01-31
2227

2328
- support for more platforms
24-
- status_output plugin - print status line on the end
29+
- `status_output` plugin - print status line on the end
2530

2631
## 0.1.0
2732
date: 2012-01-30

Gemfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#ruby=1.9.3
2-
#ruby-gemset=dtf
2+
#ruby-gemset=tf
33
source :rubygems
44

55
gem 'session'

README.md

+18-13
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,15 @@
1-
# Deryls Testing Framework
1+
# Testing Framework
22

3-
DTF is a pluggable framework for testing shell scripts (at least now).
4-
DTF also is an umbrella which incorporates (eventually) multiple gems, each of which provides additional functionality
5-
to DTF. DTF is the skeleton upon which all other dtf-* gems build.
3+
TF is a pluggable framework for testing shell scripts (at least now).
4+
TF also is an umbrella which incorporates (eventually) multiple gems, each of which provides additional functionality
5+
to TF. TF is the skeleton upon which all other tf-* gems build.
66

77

88
## Usage
99

10-
$ gem install dtf
11-
$ dtf <path/to/file>_comment_test.sh
10+
$ gem install tf
11+
$ tf <path/to/file>_comment_test.sh
12+
$ tf --text <path/to/file>_comment_test.sh
1213

1314
## Comment tests
1415

@@ -33,13 +34,13 @@ The test can be negated by replacing `=` with `!=`
3334

3435
## Example
3536

36-
$ bin/dtf example_tests/comment/*
37+
$ bin/tf example_tests/comment/*
3738
F..
3839
##### Processed commands 2 of 2, success tests 2 of 3, failure tests 1 of 3.
3940
$ false
4041
# failed: status = 0 # was 1
4142

42-
$ bin/dtf example_tests/comment/* --text
43+
$ bin/tf example_tests/comment/* --text
4344
##### starting test failure.
4445
$ false
4546
# failed: status = 0 # was 1
@@ -53,14 +54,18 @@ The test can be negated by replacing `=` with `!=`
5354

5455
Framework will load plugins from any available gem and local `lib/` path, for example:
5556

56-
lib/plugins/dtf/text_output.rb
57-
lib/plugins/dtf/status_test.rb
58-
lib/plugins/dtf/comment_test_input.rb
57+
lib/plugins/tf/text_output.rb
58+
lib/plugins/tf/status_test.rb
59+
lib/plugins/tf/comment_test_input.rb
5960

6061
The search pattern is:
6162

62-
lib/plugins/dtf/*.rb
63+
lib/plugins/tf/*.rb
6364

6465
And plugins are selected with:
6566

66-
lib/plugins/dtf/*_{input,test,output}.rb
67+
lib/plugins/tf/*_{input,test,output}.rb
68+
69+
## Thanks
70+
71+
- Deryl R. Doucette

bin/dtf bin/tf

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,6 @@
22

33
program_root = File.dirname( File.dirname( __FILE__ ) )
44

5-
require "#{program_root}/lib/dtf"
5+
require "#{program_root}/lib/tf"
66

7-
exit DTF.new.run_tests ARGV
7+
exit TF.new.run_tests ARGV

bin/dtf_test bin/tf_test

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@
22

33
program_root = File.dirname( File.dirname( __FILE__ ) )
44

5-
require "#{program_root}/lib/dtf"
5+
require "#{program_root}/lib/tf"
66

77
if ARGV.empty?
88
puts "no test files specified, use * for selecting multiple files, ex:"
9-
puts "dtf_test test/*/*"
9+
puts "tf_test test/*/*"
1010
exit 1
1111
else
1212
ARGV.each do |filename|

dtf.gemspec

-13
This file was deleted.

lib/plugins/dtf/comment_test_input.rb lib/plugins/tf/comment_test_input.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
class DTF::CommentTestInput
1+
class TF::CommentTestInput
22
def initialize
33
end
44

lib/plugins/dtf/env_match_test.rb lib/plugins/tf/env_match_test.rb

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
class DTF::EnvMatchTest
1+
class TF::EnvMatchTest
22
MATCHER = /^env\[(.*)\]([!]?=)[~]?\/(.*)\//
33

44
def matches? test
5-
test =~ DTF::EnvMatchTest::MATCHER
5+
test =~ TF::EnvMatchTest::MATCHER
66
end
77

88
def execute test, _stdout, _stderr, _stdboth, _status, env
9-
test =~ DTF::EnvMatchTest::MATCHER
9+
test =~ TF::EnvMatchTest::MATCHER
1010
variable, sign, value = $1.strip, $2, $3
1111
var_val = env[ variable ]
1212
if ( sign == "=" ) ^ ( Regexp.new(value) =~ "#{var_val}" )

lib/plugins/dtf/error_summary_output.rb lib/plugins/tf/error_summary_output.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
class DTF::ErrorSummaryOutput
1+
class TF::ErrorSummaryOutput
22
RED = `tput setaf 1`
33
GREEN = `tput setaf 2`
44
YELLOW = `tput setaf 3`

lib/plugins/dtf/output_match_test.rb lib/plugins/tf/output_match_test.rb

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
class DTF::OutputMatchTest
1+
class TF::OutputMatchTest
22
MATCHER = /^match([!]?=)[~]?\/(.*)\//
33

44
def matches? test
5-
test =~ DTF::OutputMatchTest::MATCHER
5+
test =~ TF::OutputMatchTest::MATCHER
66
end
77

88
def execute test, _stdout, _stderr, _stdboth, _status, env
9-
test =~ DTF::OutputMatchTest::MATCHER
9+
test =~ TF::OutputMatchTest::MATCHER
1010
sign, value = $1, $2
1111
if ( sign == "=" ) ^ ( Regexp.new(value) =~ "#{_stdboth}" )
1212
[ false, "failed: match #{sign} /#{value}/" ]

lib/plugins/dtf/stats_output.rb lib/plugins/tf/stats_output.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
class DTF::StatsOutput
1+
class TF::StatsOutput
22
RED = `tput setaf 1`
33
GREEN = `tput setaf 2`
44
YELLOW = `tput setaf 3`

lib/plugins/dtf/status_test.rb lib/plugins/tf/status_test.rb

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
class DTF::StatusTest
1+
class TF::StatusTest
22
MATCHER = /^status([!]?=)([[:digit:]]+)$/
33

44
def matches? test
5-
test =~ DTF::StatusTest::MATCHER
5+
test =~ TF::StatusTest::MATCHER
66
end
77

88
def execute test, _stdout, _stderr, _stdboth, _status, env
9-
test =~ DTF::StatusTest::MATCHER
9+
test =~ TF::StatusTest::MATCHER
1010
sign, value = $1, $2.to_i
1111
if ( sign == "=" ) ^ ( _status == value )
1212
[ false, "failed: status #{sign} #{value} # was #{_status}" ]

lib/plugins/dtf/text_output.rb lib/plugins/tf/text_output.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
class DTF::TextOutput
1+
class TF::TextOutput
22
RED = `tput setaf 1`
33
GREEN = `tput setaf 2`
44
YELLOW = `tput setaf 3`

lib/dtf.rb lib/tf.rb

+5-5
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,14 @@
88
# include lib in path so plugins get found with Gem.find_files
99
$:.unshift "#{lib_root}"
1010

11-
class DTF; end
12-
# load dtf/*.rb
13-
Dir["#{lib_root}/dtf/*.rb"].each{|lib| require lib }
11+
class TF; end
12+
# load tf/*.rb
13+
Dir["#{lib_root}/tf/*.rb"].each{|lib| require lib }
1414

15-
class DTF
15+
class TF
1616
def initialize
1717
@ruby = File.join(RbConfig::CONFIG["bindir"],RbConfig::CONFIG["ruby_install_name"])
18-
@plugins = DTF::Plugins.instance
18+
@plugins = TF::Plugins.instance
1919
@failures = 0
2020
end
2121

File renamed without changes.

lib/dtf/plugins.rb lib/tf/plugins.rb

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
class DTF::Plugins
1+
class TF::Plugins
22
include Singleton
33

44
def initialize
@@ -10,7 +10,7 @@ def initialize
1010
end
1111

1212
def detect
13-
@plugins = Gem.find_files('plugins/dtf/*.rb')
13+
@plugins = Gem.find_files('plugins/tf/*.rb')
1414
end
1515

1616
def add plugin
@@ -44,14 +44,14 @@ def load wanted
4444
_list = _list.select{|item, klass, _type| wanted.include?(klass) }
4545
end
4646
_list.each{|item, klass, _type|
47-
klass = DTF.const_get(klass)
47+
klass = TF.const_get(klass)
4848
instance_variable_get("@#{type}_plugins".to_sym) << klass.new
4949
}
5050
end
5151
end
5252

5353
def match_arg_klass arg, klass, type
54-
klass = DTF.const_get(klass)
54+
klass = TF.const_get(klass)
5555
return nil unless klass.respond_to? :argument_matches?
5656
matches = klass.argument_matches? arg
5757
return nil if matches.nil?

test/unit/comment_test_input.rb

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
require 'minitest/autorun'
2-
require 'plugins/dtf/comment_test_input'
2+
require 'plugins/tf/comment_test_input'
33

44
class TestCommentTestInput < MiniTest::Unit::TestCase
55
def setup
6-
@test = DTF::CommentTestInput
6+
@test = TF::CommentTestInput
77
@file1 = Tempfile.new(['','_comment_test.sh'])
88
@file2 = Tempfile.new(['','_wrong_test.sh'])
99
end

test/unit/env_match_test.rb

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
require 'minitest/autorun'
2-
require 'plugins/dtf/env_match_test'
2+
require 'plugins/tf/env_match_test'
33

44
class TestEnvMatchTest < MiniTest::Unit::TestCase
55
def setup
6-
@test = DTF::EnvMatchTest.new
6+
@test = TF::EnvMatchTest.new
77
end
88
def test_matches
99
assert @test.matches?("env[TEST]=/aa/")

test/unit/error_summary_output.rb

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
require 'minitest/autorun'
2-
require 'plugins/dtf/error_summary_output'
2+
require 'plugins/tf/error_summary_output'
33

44
class TestErrorSummaryOutput < MiniTest::Unit::TestCase
55
def setup
6-
@test = DTF::ErrorSummaryOutput.new self
6+
@test = TF::ErrorSummaryOutput.new self
77
@outputs = []
88
end
99

test/unit/output_match_test.rb

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
require 'minitest/autorun'
2-
require 'plugins/dtf/output_match_test'
2+
require 'plugins/tf/output_match_test'
33

44
class TestOutputMatchTest < MiniTest::Unit::TestCase
55
def setup
6-
@test = DTF::OutputMatchTest.new
6+
@test = TF::OutputMatchTest.new
77
end
88
def test_matches
99
assert @test.matches?("match=/aa/")

test/unit/stats_output.rb

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
require 'minitest/autorun'
2-
require 'plugins/dtf/stats_output'
2+
require 'plugins/tf/stats_output'
33

44
class TestStatsOutput < MiniTest::Unit::TestCase
55
def setup
6-
@test = DTF::StatsOutput.new
6+
@test = TF::StatsOutput.new
77
end
88

99
# Build input data, will create command for every integer passed,

test/unit/status_test.rb

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
require 'minitest/autorun'
2-
require 'plugins/dtf/status_test'
2+
require 'plugins/tf/status_test'
33

44
class TestStatusTest < MiniTest::Unit::TestCase
55
def setup
6-
@test = DTF::StatusTest.new
6+
@test = TF::StatusTest.new
77
end
88
def test_matches
99
assert @test.matches?("status=0")

tf.gemspec

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
Gem::Specification.new do |s|
2+
s.name = "tf"
3+
s.version = "0.3.0"
4+
s.summary = "Testing Framework"
5+
s.email = "[email protected]"
6+
s.homepage = "http://github.com/mpapis/tf"
7+
s.description = "Testing Framework solely based on plugins. For now only tests using Bash."
8+
s.has_rdoc = false
9+
s.author = "Michal Papis"
10+
s.add_dependency('session','~> 3.0')
11+
s.files = Dir.glob("lib/**/*") + %w( bin/tf LICENSE README.md )
12+
s.executables = %w( tf )
13+
end

0 commit comments

Comments
 (0)