testme 0.4.75 → 0.4.85
Sign up to get free protection for your applications and to get access to all the features.
- data/.testme +2 -1
- data/README.md +2 -0
- data/bin/testme +16 -6
- data/lib/logic.rb +4 -2
- data/lib/testme.rb +6 -4
- data/spec/spec_helper.rb +1 -0
- metadata +3 -3
data/.testme
CHANGED
data/README.md
CHANGED
@@ -55,6 +55,7 @@
|
|
55
55
|
require "testme"
|
56
56
|
|
57
57
|
TESTME_DIR = '/test/'
|
58
|
+
TESTME_SUFFIX = '.test.rb'
|
58
59
|
TESTME_FORMAT = :console
|
59
60
|
TESTME_COLORS = :default
|
60
61
|
|
@@ -66,6 +67,7 @@
|
|
66
67
|
Bundler.require :default, :test
|
67
68
|
|
68
69
|
TESTME_DIR = '/test/'
|
70
|
+
TESTME_SUFFIX = '.test.rb'
|
69
71
|
TESTME_FORMAT = :console
|
70
72
|
TESTME_COLORS = :default
|
71
73
|
|
data/bin/testme
CHANGED
@@ -8,6 +8,7 @@ if ARGV[0] == 'setup'
|
|
8
8
|
%q[require "testme"
|
9
9
|
|
10
10
|
TESTME_DIR = '/test/'
|
11
|
+
TESTME_SUFFIX = '.test.rb'
|
11
12
|
TESTME_FORMAT = :console
|
12
13
|
TESTME_COLORS = :default]
|
13
14
|
)} unless File.exists?("./.testme")
|
@@ -20,13 +21,13 @@ TESTME_COLORS = :default]
|
|
20
21
|
|
21
22
|
File.open('./test/app.test.rb', 'w') {|f| f.write(
|
22
23
|
""
|
23
|
-
)} unless File.exists?("./.test/app
|
24
|
+
)} unless File.exists?("./.test/app#{TestMe::TESTME_SUFFIX}")
|
24
25
|
|
25
26
|
puts 'Setup complete'
|
26
27
|
|
27
28
|
else
|
28
29
|
|
29
|
-
|
30
|
+
TESTME_INIT = true
|
30
31
|
|
31
32
|
if File.exists?("#{Dir.pwd}/.testme")
|
32
33
|
load "#{Dir.pwd}/.testme"
|
@@ -34,9 +35,11 @@ else
|
|
34
35
|
require "testme"
|
35
36
|
end
|
36
37
|
|
38
|
+
TESTME_RUNNING = true
|
39
|
+
|
37
40
|
if ARGV.empty?
|
38
41
|
testme do
|
39
|
-
Dir["#{Dir.pwd}/#{TestMe::TESTME_DIR}
|
42
|
+
Dir["#{Dir.pwd}/#{TestMe::TESTME_DIR}/**/*#{TestMe::TESTME_SUFFIX}"].each{|f| load f }
|
40
43
|
end
|
41
44
|
|
42
45
|
else
|
@@ -45,14 +48,21 @@ else
|
|
45
48
|
|
46
49
|
# Check if directory
|
47
50
|
if File.directory? @file
|
48
|
-
Dir["#{@file}/**/*.rb"].each
|
51
|
+
Dir["#{@file}/**/*.rb"].each do |f|
|
52
|
+
if @file.include? TestMe::TESTME_SUFFIX
|
53
|
+
testme do
|
54
|
+
load @file
|
55
|
+
end
|
56
|
+
else
|
57
|
+
load @file
|
58
|
+
end
|
49
59
|
elsif File.exists? @file
|
50
|
-
if @file.include?
|
60
|
+
if @file.include? TestMe::TESTME_SUFFIX
|
51
61
|
testme do
|
52
62
|
load @file
|
53
63
|
end
|
54
64
|
else
|
55
|
-
|
65
|
+
load @file
|
56
66
|
end
|
57
67
|
end
|
58
68
|
end
|
data/lib/logic.rb
CHANGED
data/lib/testme.rb
CHANGED
@@ -54,15 +54,17 @@ def testme █ end
|
|
54
54
|
# Optional configuration
|
55
55
|
# ---------------------------------------------------------------- #
|
56
56
|
module TestMe
|
57
|
-
TESTME_DIR = '/test/'
|
57
|
+
TESTME_DIR = defined?(::TESTME_DIR) ? ::TESTME_DIR : '/test/'
|
58
58
|
# default: '/test/'
|
59
59
|
|
60
|
-
|
60
|
+
TESTME_SUFFIX = defined?(::TESTME_SUFFIX) ? ::TESTME_SUFFIX : '.test.rb'
|
61
|
+
|
62
|
+
TESTME_FORMAT = defined?(::TESTME_FORMAT) ? ::TESTME_FORMAT : :console
|
61
63
|
# choose how results are displayed
|
62
64
|
# options: :none, :text, :console
|
63
65
|
# default: :console
|
64
66
|
|
65
|
-
TESTME_COLORS =
|
67
|
+
TESTME_COLORS = defined?(::TESTME_COLORS) ? ::TESTME_COLORS : :default
|
66
68
|
# color scheme for console output
|
67
69
|
# options: :default
|
68
70
|
# default: :default
|
@@ -73,7 +75,7 @@ end
|
|
73
75
|
# ---------------------------------------------------------------- #
|
74
76
|
# This is here to disable inline tests at runtime
|
75
77
|
# ---------------------------------------------------------------- #
|
76
|
-
if defined?
|
78
|
+
if defined? TESTME_INIT
|
77
79
|
# Gems
|
78
80
|
require 'rainbow'
|
79
81
|
require 'colorize'
|
data/spec/spec_helper.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: testme
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.4.
|
4
|
+
version: 0.4.85
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -85,7 +85,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
85
85
|
version: '0'
|
86
86
|
segments:
|
87
87
|
- 0
|
88
|
-
hash: -
|
88
|
+
hash: -363458065
|
89
89
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
90
90
|
none: false
|
91
91
|
requirements:
|
@@ -94,7 +94,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
94
94
|
version: '0'
|
95
95
|
segments:
|
96
96
|
- 0
|
97
|
-
hash: -
|
97
|
+
hash: -363458065
|
98
98
|
requirements: []
|
99
99
|
rubyforge_project:
|
100
100
|
rubygems_version: 1.8.24
|