testme 0.6.2 → 0.6.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. data/README.md +4 -2
  2. data/lib/formatter.rb +15 -1
  3. metadata +4 -4
data/README.md CHANGED
@@ -3,7 +3,9 @@
3
3
 
4
4
  test Me
5
5
  given simple: true
6
- is? :simple
6
+ is? :simple
7
+
8
+ ####For Ruby 1.9
7
9
 
8
10
  ## Cheatsheet
9
11
  - ` -'this is a test description'` - Describe the context (if necessary)
@@ -119,7 +121,7 @@ The `/test/` folder will house all your test files, you can change this in your
119
121
 
120
122
  `testme.format`
121
123
  * choose how results are displayed
122
- * options: :none, :text, :console
124
+ * options: :none, :console
123
125
  * default: :console
124
126
 
125
127
  `testme.colors`
@@ -66,7 +66,21 @@ module TestMe
66
66
  private
67
67
  def block_to_string &block
68
68
  loc = block.source_location
69
- `head -#{loc[1]} #{loc[0]} | tail -1 | grep -o {.*}`[2..-4]
69
+ read_line_number(loc[0], loc[1]).scan(/{.*}/)[0][2..-2]
70
+ end
71
+
72
+ def read_line_number(filename, number)
73
+ counter = 0
74
+ line = nil
75
+ File.foreach(filename) do |line|
76
+ counter += 1
77
+ if counter == number
78
+ line.chomp!
79
+ return line
80
+ end
81
+ end
82
+ line = nil if counter != number
83
+ line
70
84
  end
71
85
 
72
86
  def log msg
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.6.2
4
+ version: 0.6.3
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-10-10 00:00:00.000000000 Z
12
+ date: 2012-10-16 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rainbow
@@ -103,7 +103,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
103
103
  version: '0'
104
104
  segments:
105
105
  - 0
106
- hash: 1897896740676466632
106
+ hash: -2471649037672205512
107
107
  required_rubygems_version: !ruby/object:Gem::Requirement
108
108
  none: false
109
109
  requirements:
@@ -112,7 +112,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
112
112
  version: '0'
113
113
  segments:
114
114
  - 0
115
- hash: 1897896740676466632
115
+ hash: -2471649037672205512
116
116
  requirements: []
117
117
  rubyforge_project:
118
118
  rubygems_version: 1.8.24