testme 0.4.35 → 0.4.65

Sign up to get free protection for your applications and to get access to all the features.
Files changed (8) hide show
  1. data/.gitignore +1 -0
  2. data/.testme +1 -4
  3. data/Gemfile +1 -0
  4. data/README.md +27 -14
  5. data/Rakefile +6 -0
  6. data/bin/testme +49 -21
  7. data/test/app.test.rb +0 -0
  8. metadata +9 -1
data/.gitignore CHANGED
@@ -4,3 +4,4 @@ doc
4
4
  .DS_Store
5
5
  /Gemfile.lock
6
6
  /notes
7
+ /*.gem
data/.testme CHANGED
@@ -1,7 +1,4 @@
1
- require "rubygems"
2
- require "bundler"
3
- require "bundler/setup"
4
- Bundler.require :default, :test
1
+ require "testme"
5
2
 
6
3
  TESTME_DIR = '/test/'
7
4
  TESTME_FORMAT = :console
data/Gemfile CHANGED
@@ -2,4 +2,5 @@ source :rubygems
2
2
 
3
3
  gemspec
4
4
 
5
+ gem 'rake'
5
6
  gem 'rspec', '>= 2.11.0'
data/README.md CHANGED
@@ -39,28 +39,41 @@
39
39
 
40
40
  ## Setup
41
41
 
42
- #### Put in your Gemfile
42
+ `gem install testme`
43
43
 
44
- `gem "testme", :git => "git@github.com:DanielShuey/testme.git"`
44
+ *Then in your project root directory*
45
45
 
46
- ## Config
46
+ `testme setup`
47
+
48
+ /.testme
49
+ /test/
50
+ /test/app.test.rb
47
51
 
48
- ##### Put a `.testme` file in your project root to set up a bootstrap
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
- *in ~/project_root/.testme*
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
- $ bundle exec testme
100
+ $ testme
88
101
 
89
102
  #### Test all in directory
90
103
 
91
- $ bundle exec testme test/features
104
+ $ testme test/features
92
105
 
93
106
  #### Test file
94
107
 
95
- $ bundle exec testme test/account.test.rb
108
+ $ testme test/account.test.rb
96
109
 
97
110
  #### Inline testing
98
111
 
99
- $ bundle exec testme app/models
112
+ $ testme app/models
100
113
 
101
114
  ##### Inline testing examples
102
115
 
data/Rakefile ADDED
@@ -0,0 +1,6 @@
1
+ task :push do
2
+ puts `rm *.gem`
3
+ puts `gem build testme.gemspec`
4
+ puts `gem push *.gem`
5
+ puts `rm *.gem`
6
+ end
data/bin/testme CHANGED
@@ -1,34 +1,62 @@
1
1
  #!/usr/bin/env ruby
2
2
 
3
- TESTME_RUNNING = true
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
- if ARGV.empty?
12
- testme do
13
- Dir["#{Dir.pwd}/#{TestMe::TESTME_DIR}/**/*.rb"].each{|f| load f }
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
- 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
26
- load @file
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.35
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