testme 0.4.9 → 0.4.35
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +0 -1
- data/.testme +8 -0
- data/Gemfile +0 -1
- data/README.md +14 -29
- data/bin/testme +20 -58
- data/lib/logic.rb +2 -4
- data/lib/testme.rb +4 -6
- data/spec/spec_helper.rb +0 -1
- metadata +2 -8
- data/Rakefile +0 -6
data/.gitignore
CHANGED
data/.testme
ADDED
data/Gemfile
CHANGED
data/README.md
CHANGED
@@ -39,43 +39,28 @@
|
|
39
39
|
|
40
40
|
## Setup
|
41
41
|
|
42
|
-
|
42
|
+
#### Put in your Gemfile
|
43
43
|
|
44
|
-
|
44
|
+
`gem "testme", :git => "git@github.com:DanielShuey/testme.git"`
|
45
45
|
|
46
|
-
|
47
|
-
|
48
|
-
/.testme
|
49
|
-
/test/
|
50
|
-
/test/app.test.rb
|
46
|
+
## Config
|
51
47
|
|
52
|
-
|
53
|
-
|
48
|
+
##### Put a `.testme` file in your project root to set up a bootstrap
|
49
|
+
|
50
|
+
### Config Boiler plate
|
54
51
|
|
55
|
-
|
56
|
-
|
57
|
-
TESTME_DIR = '/test/'
|
58
|
-
TESTME_SUFFIX = '.test.rb'
|
59
|
-
TESTME_FORMAT = :console
|
60
|
-
TESTME_COLORS = :default
|
61
|
-
|
62
|
-
#### Example config with bundler
|
52
|
+
*in ~/project_root/.testme*
|
63
53
|
|
64
54
|
require "rubygems"
|
65
55
|
require "bundler"
|
66
56
|
require "bundler/setup"
|
67
57
|
Bundler.require :default, :test
|
68
|
-
|
58
|
+
|
69
59
|
TESTME_DIR = '/test/'
|
70
|
-
TESTME_SUFFIX = '.test.rb'
|
71
60
|
TESTME_FORMAT = :console
|
72
61
|
TESTME_COLORS = :default
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
In your project root will be a `.testme` file, this is your bootstrap that runs before your tests
|
77
|
-
|
78
|
-
The `/test/` folder will house all your test files, you can change this in your bootstrap
|
62
|
+
|
63
|
+
***
|
79
64
|
|
80
65
|
### Config options
|
81
66
|
|
@@ -99,19 +84,19 @@ TESTME_COLORS = :default
|
|
99
84
|
#### Test all
|
100
85
|
default test folder: `/test/**/*`
|
101
86
|
|
102
|
-
$ testme
|
87
|
+
$ bundle exec testme
|
103
88
|
|
104
89
|
#### Test all in directory
|
105
90
|
|
106
|
-
$ testme test/features
|
91
|
+
$ bundle exec testme test/features
|
107
92
|
|
108
93
|
#### Test file
|
109
94
|
|
110
|
-
$ testme test/account.test.rb
|
95
|
+
$ bundle exec testme test/account.test.rb
|
111
96
|
|
112
97
|
#### Inline testing
|
113
98
|
|
114
|
-
$ testme app/models
|
99
|
+
$ bundle exec testme app/models
|
115
100
|
|
116
101
|
##### Inline testing examples
|
117
102
|
|
data/bin/testme
CHANGED
@@ -1,70 +1,32 @@
|
|
1
1
|
#!/usr/bin/env ruby
|
2
2
|
|
3
|
-
|
4
|
-
|
5
|
-
puts 'Creating bootstrap "/.testme"'
|
6
|
-
|
7
|
-
File.open("./.testme", "w") {|f| f.write(
|
8
|
-
%q[require "testme"
|
9
|
-
|
10
|
-
TESTME_DIR = '/test/'
|
11
|
-
TESTME_SUFFIX = '.test.rb'
|
12
|
-
TESTME_FORMAT = :console
|
13
|
-
TESTME_COLORS = :default]
|
14
|
-
)} unless File.exists?("./.testme")
|
15
|
-
|
16
|
-
puts 'Creating test folder "/test"'
|
17
|
-
|
18
|
-
Dir::mkdir('./test/') unless File.directory?("./test/") || File.exists?("./test/")
|
19
|
-
|
20
|
-
puts 'Creating empty test file "/app.test.rb"'
|
21
|
-
|
22
|
-
File.open('./test/app.test.rb', 'w') {|f| f.write(
|
23
|
-
""
|
24
|
-
)} unless File.exists?("./.test/app.test.rb")
|
25
|
-
|
26
|
-
puts 'Setup complete'
|
3
|
+
TESTME_RUNNING = true
|
27
4
|
|
5
|
+
if File.exists?("#{Dir.pwd}/.testme")
|
6
|
+
load "#{Dir.pwd}/.testme"
|
28
7
|
else
|
8
|
+
require "testme"
|
9
|
+
end
|
29
10
|
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
load "#{Dir.pwd}/.testme"
|
34
|
-
else
|
35
|
-
require "testme"
|
11
|
+
if ARGV.empty?
|
12
|
+
testme do
|
13
|
+
Dir["#{Dir.pwd}/#{TestMe::TESTME_DIR}/**/*.rb"].each{|f| load f }
|
36
14
|
end
|
37
15
|
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
# Check if directory
|
50
|
-
if File.directory?(@file)
|
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
|
59
|
-
end
|
60
|
-
elsif File.exists?(@file)
|
61
|
-
if @file.include?(TestMe::TESTME_SUFFIX)
|
62
|
-
testme do
|
63
|
-
load @file
|
64
|
-
end
|
65
|
-
else
|
16
|
+
else
|
17
|
+
ARGV.each do |arg|
|
18
|
+
@file = "#{Dir.pwd}/#{arg}"
|
19
|
+
|
20
|
+
# Check if directory
|
21
|
+
if File.directory? @file
|
22
|
+
Dir["#{@file}/**/*.rb"].each{|f| load f }
|
23
|
+
elsif File.exists? @file
|
24
|
+
if @file.include? '.test.rb'
|
25
|
+
testme do
|
66
26
|
load @file
|
67
27
|
end
|
28
|
+
else
|
29
|
+
require @file
|
68
30
|
end
|
69
31
|
end
|
70
32
|
end
|
data/lib/logic.rb
CHANGED
data/lib/testme.rb
CHANGED
@@ -54,17 +54,15 @@ def testme █ end
|
|
54
54
|
# Optional configuration
|
55
55
|
# ---------------------------------------------------------------- #
|
56
56
|
module TestMe
|
57
|
-
TESTME_DIR =
|
57
|
+
TESTME_DIR = '/test/' unless defined? TESTME_DIR
|
58
58
|
# default: '/test/'
|
59
59
|
|
60
|
-
|
61
|
-
|
62
|
-
TESTME_FORMAT = defined?(::TESTME_FORMAT) ? ::TESTME_FORMAT : :console
|
60
|
+
TESTME_FORMAT = :console unless defined? TESTME_FORMAT
|
63
61
|
# choose how results are displayed
|
64
62
|
# options: :none, :text, :console
|
65
63
|
# default: :console
|
66
64
|
|
67
|
-
TESTME_COLORS = defined?
|
65
|
+
TESTME_COLORS = :default unless defined? TESTME_COLORS
|
68
66
|
# color scheme for console output
|
69
67
|
# options: :default
|
70
68
|
# default: :default
|
@@ -75,7 +73,7 @@ end
|
|
75
73
|
# ---------------------------------------------------------------- #
|
76
74
|
# This is here to disable inline tests at runtime
|
77
75
|
# ---------------------------------------------------------------- #
|
78
|
-
if defined?
|
76
|
+
if defined? TESTME_RUNNING
|
79
77
|
# Gems
|
80
78
|
require 'rainbow'
|
81
79
|
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.35
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -56,10 +56,10 @@ files:
|
|
56
56
|
- .gitignore
|
57
57
|
- .rspec
|
58
58
|
- .rvmrc
|
59
|
+
- .testme
|
59
60
|
- Gemfile
|
60
61
|
- LICENSE
|
61
62
|
- README.md
|
62
|
-
- Rakefile
|
63
63
|
- bin/testme
|
64
64
|
- lib/double.rb
|
65
65
|
- lib/formatter.rb
|
@@ -82,18 +82,12 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
82
82
|
- - ! '>='
|
83
83
|
- !ruby/object:Gem::Version
|
84
84
|
version: '0'
|
85
|
-
segments:
|
86
|
-
- 0
|
87
|
-
hash: 286752561
|
88
85
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
89
86
|
none: false
|
90
87
|
requirements:
|
91
88
|
- - ! '>='
|
92
89
|
- !ruby/object:Gem::Version
|
93
90
|
version: '0'
|
94
|
-
segments:
|
95
|
-
- 0
|
96
|
-
hash: 286752561
|
97
91
|
requirements: []
|
98
92
|
rubyforge_project:
|
99
93
|
rubygems_version: 1.8.24
|