rocha 0.2.1 → 0.2.2

Sign up to get free protection for your applications and to get access to all the features.
data/.travis.yml ADDED
@@ -0,0 +1,5 @@
1
+ rvm:
2
+ - "1.9.3"
3
+ - "1.9.2"
4
+ - jruby-19mode
5
+ - rbx-19mode
data/README.md CHANGED
@@ -1,4 +1,9 @@
1
1
  # Rocha
2
+ ---
3
+ Rocha is an [rspec](http://github.com/rspec/rspec) reporter for [mocha](https://github.com/visionmedia/mocha) javascript test framework.
4
+ It is useful in projects that run javascript tests in
5
+ ruby environments (using [capybara](https://github.com/jnicklas/capybara) for example)
6
+ like [konacha](https://github.com/jfirebaugh/konacha).
2
7
 
3
8
  ## Installation
4
9
 
@@ -6,15 +11,11 @@ Add this line to your application's Gemfile:
6
11
 
7
12
  gem 'rocha'
8
13
 
9
- And then execute:
10
-
11
- $ bundle
12
-
13
- Or install it yourself as:
14
+ ## Usage
14
15
 
15
- $ gem install rocha
16
+ Most of the time you will instantiate a `Rocha::Reporter` with an array of formatters.
17
+ Rocha comes with a simple `Rocha::Formatter` bnut you can use most [rspec](http://github.com/rspec/rspec) formatters.
16
18
 
17
- ## Usage
18
19
 
19
20
  ## Contributing
20
21
 
@@ -73,6 +73,14 @@ module Rocha
73
73
  @pending_count += 1
74
74
  end
75
75
 
76
+ if method == :example_pending
77
+ call_formatters(:example_started, *args, &block)
78
+ end
79
+
80
+ call_formatters(method, *args, &block)
81
+ end
82
+
83
+ def call_formatters(method, *args, &block)
76
84
  @formatters.each do |formatter|
77
85
  formatter.send method, *args, &block
78
86
  end
@@ -24,7 +24,8 @@ module Rocha
24
24
  end
25
25
 
26
26
  def file_path
27
- data['path']
27
+ # FIXME: This is needed to not crash in RSpec formatters
28
+ data['path'] || '<script.js>'
28
29
  end
29
30
 
30
31
  alias_method :location, :file_path
data/lib/rocha/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Rocha
2
- VERSION = "0.2.1"
2
+ VERSION = "0.2.2"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rocha
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.1
4
+ version: 0.2.2
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-11-14 00:00:00.000000000 Z
12
+ date: 2012-11-15 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: colorize
@@ -83,6 +83,7 @@ extensions: []
83
83
  extra_rdoc_files: []
84
84
  files:
85
85
  - .gitignore
86
+ - .travis.yml
86
87
  - Gemfile
87
88
  - LICENSE
88
89
  - README.md
@@ -115,7 +116,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
115
116
  version: '0'
116
117
  segments:
117
118
  - 0
118
- hash: 2962231575827768551
119
+ hash: -513491051854332956
119
120
  required_rubygems_version: !ruby/object:Gem::Requirement
120
121
  none: false
121
122
  requirements:
@@ -124,7 +125,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
124
125
  version: '0'
125
126
  segments:
126
127
  - 0
127
- hash: 2962231575827768551
128
+ hash: -513491051854332956
128
129
  requirements: []
129
130
  rubyforge_project:
130
131
  rubygems_version: 1.8.23