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