testme 0.4.7 → 0.4.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/.testme CHANGED
@@ -1,5 +1,6 @@
1
1
  require "testme"
2
2
 
3
3
  TESTME_DIR = '/test/'
4
+ TESTME_SUFFIX = '.test.rb'
4
5
  TESTME_FORMAT = :console
5
6
  TESTME_COLORS = :default
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
- )}
24
+ )} unless File.exists?("./.test/app#{TestMe::TESTME_SUFFIX}")
24
25
 
25
26
  puts 'Setup complete'
26
27
 
27
28
  else
28
29
 
29
- TESTME_RUNNING = true
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}/**/*.rb"].each{|f| load f }
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{|f| load f }
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? '.test.rb'
60
+ if @file.include? TestMe::TESTME_SUFFIX
51
61
  testme do
52
62
  load @file
53
63
  end
54
64
  else
55
- require @file
65
+ load @file
56
66
  end
57
67
  end
58
68
  end
@@ -1,6 +1,8 @@
1
1
  def testme &block
2
- extend TestMe
3
- block.call
2
+ if defined? TESTME_RUNNING
3
+ extend TestMe
4
+ block.call
5
+ end
4
6
  end
5
7
 
6
8
  module TestMe
@@ -54,15 +54,17 @@ def testme █ end
54
54
  # Optional configuration
55
55
  # ---------------------------------------------------------------- #
56
56
  module TestMe
57
- TESTME_DIR = '/test/' unless defined? TESTME_DIR
57
+ TESTME_DIR = ::TESTME_DIR ? ::TESTME_DIR : '/test/'
58
58
  # default: '/test/'
59
59
 
60
- TESTME_FORMAT = :console unless defined? TESTME_FORMAT
60
+ TESTME_SUFFIX = ::TESTME_SUFFIX ? ::TESTME_SUFFIX : '.test.rb'
61
+
62
+ TESTME_FORMAT = ::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 = :default unless defined? TESTME_COLORS
67
+ TESTME_COLORS = ::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? TESTME_RUNNING
78
+ if defined? TESTME_INIT
77
79
  # Gems
78
80
  require 'rainbow'
79
81
  require 'colorize'
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.7
4
+ version: 0.4.8
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -70,7 +70,6 @@ files:
70
70
  - spec/double_spec.rb
71
71
  - spec/spec_helper.rb
72
72
  - spec/testme_spec.rb
73
- - test/app.test.rb
74
73
  - testme.gemspec
75
74
  homepage: http://github.com/danielshuey/testme
76
75
  licenses: []
@@ -86,7 +85,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
86
85
  version: '0'
87
86
  segments:
88
87
  - 0
89
- hash: 88814589
88
+ hash: -630431999
90
89
  required_rubygems_version: !ruby/object:Gem::Requirement
91
90
  none: false
92
91
  requirements:
@@ -95,7 +94,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
95
94
  version: '0'
96
95
  segments:
97
96
  - 0
98
- hash: 88814589
97
+ hash: -630431999
99
98
  requirements: []
100
99
  rubyforge_project:
101
100
  rubygems_version: 1.8.24
File without changes