shindo 0.3.3 → 0.3.4

Sign up to get free protection for your applications and to get access to all the features.
@@ -6,7 +6,7 @@ module Shindo
6
6
  class Pending < StandardError; end
7
7
 
8
8
  unless const_defined?(:VERSION)
9
- VERSION = '0.3.3'
9
+ VERSION = '0.3.4'
10
10
  end
11
11
 
12
12
  def self.tests(description = nil, tags = [], &block)
@@ -59,6 +59,7 @@ module Shindo
59
59
  @afters.push([])
60
60
 
61
61
  @description = nil
62
+ @inline = false
62
63
  description ||= 'Shindo.tests'
63
64
  description = "[bold]#{description}[normal]"
64
65
  unless tags.empty?
@@ -72,16 +73,21 @@ module Shindo
72
73
  if block_given?
73
74
  begin
74
75
  display_description(description)
75
- Formatador.indent { instance_eval(&block) }
76
+ # HACK: increase indent
77
+ indent = Thread.current[:formatador].instance_variable_get(:@indent)
78
+ Thread.current[:formatador].instance_variable_set(:@indent, indent + 1)
79
+ instance_eval(&block)
76
80
  rescue Shindo::Pending
77
81
  display_pending(description)
78
- # HACK: remove indent since above doesn't
79
- indent = Thread.current[:formatador].instance_variable_get(:@indent)
80
- Thread.current[:formatador].instance_variable_set(:@indent, indent - 1)
81
82
  rescue => error
82
83
  display_error(error)
84
+ ensure
85
+ # HACK: decrease indent
86
+ indent = Thread.current[:formatador].instance_variable_get(:@indent)
87
+ Thread.current[:formatador].instance_variable_set(:@indent, indent - 1)
83
88
  end
84
89
  else
90
+ @inline = true
85
91
  display_description(description)
86
92
  end
87
93
  else
@@ -4,7 +4,12 @@ module Shindo
4
4
  private
5
5
 
6
6
  def display_description(description)
7
- Formatador.display_line(description)
7
+ unless @inline
8
+ Formatador.display_line(description)
9
+ else
10
+ Formatador.display(description)
11
+ print ' '
12
+ end
8
13
  end
9
14
 
10
15
  def display_error(error)
@@ -18,17 +23,29 @@ module Shindo
18
23
 
19
24
  def display_failure(description)
20
25
  Thread.current[:totals][:failed] += 1
21
- Formatador.display_line("[red]- #{description}[/]")
26
+ unless @inline
27
+ Formatador.display_line("[red]- #{description}[/]")
28
+ else
29
+ print Formatador.parse("[red]- #{description}[/]\n")
30
+ end
22
31
  end
23
32
 
24
33
  def display_pending(description)
25
34
  Thread.current[:totals][:pending] += 1
26
- Formatador.display_line("[yellow]# #{description}[/]")
35
+ unless @inline
36
+ Formatador.display_line("[yellow]# #{description}[/]")
37
+ else
38
+ print Formatador.parse("[yellow]# #{description}[/]\n")
39
+ end
27
40
  end
28
41
 
29
42
  def display_success(description)
30
43
  Thread.current[:totals][:succeeded] += 1
31
- Formatador.display_line("[green]+ #{description}[/]")
44
+ unless @inline
45
+ Formatador.display_line("[green]+ #{description}[/]")
46
+ else
47
+ print Formatador.parse("[green]+ #{description}[/]\n")
48
+ end
32
49
  end
33
50
 
34
51
  end
@@ -13,8 +13,8 @@ Gem::Specification.new do |s|
13
13
  ## If your rubyforge_project name is different, then edit it and comment out
14
14
  ## the sub! line in the Rakefile
15
15
  s.name = 'shindo'
16
- s.version = '0.3.3'
17
- s.date = '2011-03-14'
16
+ s.version = '0.3.4'
17
+ s.date = '2011-03-21'
18
18
  s.rubyforge_project = 'shindo'
19
19
 
20
20
  ## Make sure your summary is short. The description may be as long
@@ -60,7 +60,6 @@ Gem::Specification.new do |s|
60
60
  # = MANIFEST =
61
61
  s.files = %w[
62
62
  Gemfile
63
- Gemfile.lock
64
63
  README.rdoc
65
64
  Rakefile
66
65
  bin/shindo
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: shindo
3
3
  version: !ruby/object:Gem::Version
4
- hash: 21
4
+ hash: 27
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 3
9
- - 3
10
- version: 0.3.3
9
+ - 4
10
+ version: 0.3.4
11
11
  platform: ruby
12
12
  authors:
13
13
  - geemus (Wesley Beary)
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2011-03-14 00:00:00 -07:00
18
+ date: 2011-03-21 00:00:00 -07:00
19
19
  default_executable: shindo
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency
@@ -45,7 +45,6 @@ extra_rdoc_files:
45
45
  - README.rdoc
46
46
  files:
47
47
  - Gemfile
48
- - Gemfile.lock
49
48
  - README.rdoc
50
49
  - Rakefile
51
50
  - bin/shindo
@@ -1,16 +0,0 @@
1
- PATH
2
- remote: .
3
- specs:
4
- shindo (0.3.2)
5
- formatador (>= 0.1.1)
6
-
7
- GEM
8
- remote: http://rubygems.org/
9
- specs:
10
- formatador (0.1.1)
11
-
12
- PLATFORMS
13
- ruby
14
-
15
- DEPENDENCIES
16
- shindo!