fas_test 0.1.4 → 0.1.5

Sign up to get free protection for your applications and to get access to all the features.
data/bin/fastest CHANGED
@@ -1,7 +1,7 @@
1
- #!/usr/bin/ruby
1
+ #!/usr/bin/env ruby
2
2
 
3
3
  require 'fas_test'
4
4
 
5
- test_runner = FasTest::TestRunner.new
5
+ test_runner = FasTest::TestRunner.new ARGV.any? { |a| a == "-v" }
6
6
  test_runner.run_tests_in_folder(".")
7
7
  test_runner.print_summary
data/fas_test.gemspec CHANGED
@@ -1,6 +1,6 @@
1
1
  spec = Gem::Specification.new do |s|
2
2
  s.name = "fas_test"
3
- s.version = "0.1.4"
3
+ s.version = "0.1.5"
4
4
  s.authors = ["Graeme Hill"]
5
5
  s.email = "graemekh@gmail.com"
6
6
  s.homepage = "https://github.com/graeme-hill/fas_test"
data/lib/fas_test.rb CHANGED
@@ -107,7 +107,9 @@ module FasTest
107
107
  end
108
108
 
109
109
  def pretty_print_stack_trace(exception)
110
- exception.backtrace.each { |trace| puts " #{trace}"}
110
+ if @verbose
111
+ exception.backtrace.each { |trace| puts " #{trace}"}
112
+ end
111
113
  end
112
114
 
113
115
  def run_tests_in_folder(path)
@@ -122,14 +124,15 @@ module FasTest
122
124
  end
123
125
 
124
126
  def get_all_test_method_names(test_class)
125
- test_class.instance_methods.find_all { |m| m.start_with?('test__') }
127
+ test_class.instance_methods.find_all { |m| m.to_s.start_with?('test__') }
126
128
  end
127
129
 
128
130
  def find_test_classes
129
131
  classes = []
130
132
  Module.constants.each do |constant|
131
- if constant.end_with? "Tests"
132
- classes << eval(constant)
133
+ constant_str = constant.to_s
134
+ if constant_str.end_with? "Tests"
135
+ classes << eval(constant_str)
133
136
  end
134
137
  end
135
138
  return classes
@@ -183,7 +186,7 @@ module FasTest
183
186
  def assert_true(expression, msg = "<no msg given>")
184
187
  @runner.increment_assert_count
185
188
  if expression != true
186
- raise AssertionException, "expected true but got #{expression.to_s}"
189
+ raise AssertionException, "#{msg} | expected true but got #{expression.to_s}"
187
190
  end
188
191
  end
189
192
 
@@ -1,7 +1,7 @@
1
1
  require 'rubygems'
2
2
  require 'sqlite3'
3
3
  require 'stringio'
4
- require 'lib/fas_test'
4
+ require './lib/fas_test'
5
5
 
6
6
  class FasTestTests < FasTest::TestClass
7
7
 
metadata CHANGED
@@ -1,13 +1,8 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fas_test
3
3
  version: !ruby/object:Gem::Version
4
- hash: 19
5
4
  prerelease:
6
- segments:
7
- - 0
8
- - 1
9
- - 4
10
- version: 0.1.4
5
+ version: 0.1.5
11
6
  platform: ruby
12
7
  authors:
13
8
  - Graeme Hill
@@ -15,7 +10,7 @@ autorequire:
15
10
  bindir: bin
16
11
  cert_chain: []
17
12
 
18
- date: 2011-02-25 00:00:00 -08:00
13
+ date: 2011-02-28 00:00:00 -08:00
19
14
  default_executable:
20
15
  dependencies: []
21
16
 
@@ -47,18 +42,12 @@ required_ruby_version: !ruby/object:Gem::Requirement
47
42
  requirements:
48
43
  - - ">="
49
44
  - !ruby/object:Gem::Version
50
- hash: 3
51
- segments:
52
- - 0
53
45
  version: "0"
54
46
  required_rubygems_version: !ruby/object:Gem::Requirement
55
47
  none: false
56
48
  requirements:
57
49
  - - ">="
58
50
  - !ruby/object:Gem::Version
59
- hash: 3
60
- segments:
61
- - 0
62
51
  version: "0"
63
52
  requirements: []
64
53