Permalink
Browse files

Get build to pass on jruby.

- Closes #341.
  • Loading branch information...
1 parent a1064cf commit bd3aac8af610905a46d1a6b7fc8e67146b761175 @kaiwren kaiwren committed with dchelimsky Mar 24, 2011
View
@@ -26,7 +26,7 @@ if RUBY_PLATFORM =~ /darwin/
gem "autotest-growl", "~> 0.2.9"
end
-gem "ruby-debug", :platforms => :mri_18
+gem "ruby-debug", :platforms => [:mri_18, :jruby]
gem "ruby-debug19", "~> 0.11.6", :platforms => :mri_19
case RUBY_VERSION
@@ -46,6 +46,7 @@
end
it "doesn't hang when file exists" do
+ pending("This issue still exists on JRuby, but should be resolved shortly: https://github.com/rspec/rspec-core/issues/295", :if => RUBY_ENGINE == 'jruby')
exception = mock(:Exception, :backtrace => [ "#{__FILE__}:#{__LINE__}"])
example = mock(:Example, :file_path => __FILE__)
@@ -318,13 +318,12 @@
./spec/rspec/core/formatters/html_formatter_spec.rb:46:in `open'
./spec/rspec/core/formatters/html_formatter_spec.rb:46
./spec/rspec/core/formatters/html_formatter_spec.rb:45:in `chdir'
-./spec/rspec/core/formatters/html_formatter_spec.rb:45
-:1</pre></div>
- <pre class="ruby"><code><span class="linenum">22</span> <span class="keyword">rescue</span> <span class="constant">Exception</span> <span class="punct">=&gt;</span> <span class="ident">e</span>
-<span class="linenum">23</span> <span class="keyword">end</span>
-<span class="offending"><span class="linenum">24</span> <span class="keyword">raise</span> <span class="constant">RSpec</span><span class="punct">::</span><span class="constant">Core</span><span class="punct">::</span><span class="constant">PendingExampleFixedError</span><span class="punct">.</span><span class="ident">new</span> <span class="keyword">if</span> <span class="ident">result</span></span>
-<span class="linenum">25</span> <span class="keyword">end</span>
-<span class="linenum">26</span> <span class="ident">throw</span> <span class="symbol">:pending_declared_in_example</span><span class="punct">,</span> <span class="ident">message</span></code></pre>
+./spec/rspec/core/formatters/html_formatter_spec.rb:45</pre></div>
+ <pre class="ruby"><code><span class="linenum">24</span> <span class="keyword">rescue</span> <span class="constant">Exception</span>
+<span class="linenum">25</span> <span class="keyword">end</span>
+<span class="offending"><span class="linenum">26</span> <span class="keyword">raise</span> <span class="constant">RSpec</span><span class="punct">::</span><span class="constant">Core</span><span class="punct">::</span><span class="constant">PendingExampleFixedError</span><span class="punct">.</span><span class="ident">new</span> <span class="keyword">if</span> <span class="ident">result</span></span>
+<span class="linenum">27</span> <span class="keyword">end</span>
+<span class="linenum">28</span> <span class="keyword">raise</span> <span class="constant">PendingDeclaredInExample</span><span class="punct">.</span><span class="ident">new</span><span class="punct">(</span><span class="ident">message</span><span class="punct">)</span></code></pre>
</div>
</dd>
</dl>
@@ -357,8 +356,7 @@
./spec/rspec/core/formatters/html_formatter_spec.rb:46:in `open'
./spec/rspec/core/formatters/html_formatter_spec.rb:46
./spec/rspec/core/formatters/html_formatter_spec.rb:45:in `chdir'
-./spec/rspec/core/formatters/html_formatter_spec.rb:45
-:1</pre></div>
+./spec/rspec/core/formatters/html_formatter_spec.rb:45</pre></div>
<pre class="ruby"><code><span class="linenum">27</span> <span class="keyword">end</span>
<span class="linenum">28</span>
<span class="offending"><span class="linenum">29</span> <span class="keyword">raise</span><span class="punct">(</span><span class="constant">RSpec</span><span class="punct">::</span><span class="constant">Expectations</span><span class="punct">::</span><span class="constant">ExpectationNotMetError</span><span class="punct">.</span><span class="ident">new</span><span class="punct">(</span><span class="ident">message</span><span class="punct">))</span></span>
@@ -385,7 +383,7 @@
<dd class="example failed">
<span class="failed_spec_name">fails with a backtrace containing an erb file</span>
<div class="failure" id="failure_4">
- <div class="message"><pre>#&lt;Class:01xf45673&gt;</pre></div>
+ <div class="message"><pre>Exception</pre></div>
<div class="backtrace"><pre>/foo.html.erb:1:in `<main>': foo (RuntimeError)</pre></div>
<pre class="ruby"><code><span class="linenum">-1</span><span class="comment"># Couldn't get snippet for /foo.html.erb</span></code></pre>
</div>
@@ -318,13 +318,12 @@
<a href="txmt://open?url=file:///Users/david/projects/ruby/rspec2/repos/rspec-core/spec/rspec/core/formatters/text_mate_formatter_spec.rb&line=47">./spec/rspec/core/formatters/text_mate_formatter_spec.rb:47</a> :in `open'
<a href="txmt://open?url=file:///Users/david/projects/ruby/rspec2/repos/rspec-core/spec/rspec/core/formatters/text_mate_formatter_spec.rb&line=47">./spec/rspec/core/formatters/text_mate_formatter_spec.rb:47</a>
<a href="txmt://open?url=file:///Users/david/projects/ruby/rspec2/repos/rspec-core/spec/rspec/core/formatters/text_mate_formatter_spec.rb&line=46">./spec/rspec/core/formatters/text_mate_formatter_spec.rb:46</a> :in `chdir'
-<a href="txmt://open?url=file:///Users/david/projects/ruby/rspec2/repos/rspec-core/spec/rspec/core/formatters/text_mate_formatter_spec.rb&line=46">./spec/rspec/core/formatters/text_mate_formatter_spec.rb:46</a>
-:1</pre></div>
- <pre class="ruby"><code><span class="linenum">22</span> <span class="keyword">rescue</span> <span class="constant">Exception</span> <span class="punct">=&gt;</span> <span class="ident">e</span>
-<span class="linenum">23</span> <span class="keyword">end</span>
-<span class="offending"><span class="linenum">24</span> <span class="keyword">raise</span> <span class="constant">RSpec</span><span class="punct">::</span><span class="constant">Core</span><span class="punct">::</span><span class="constant">PendingExampleFixedError</span><span class="punct">.</span><span class="ident">new</span> <span class="keyword">if</span> <span class="ident">result</span></span>
-<span class="linenum">25</span> <span class="keyword">end</span>
-<span class="linenum">26</span> <span class="ident">throw</span> <span class="symbol">:pending_declared_in_example</span><span class="punct">,</span> <span class="ident">message</span></code></pre>
+<a href="txmt://open?url=file:///Users/david/projects/ruby/rspec2/repos/rspec-core/spec/rspec/core/formatters/text_mate_formatter_spec.rb&line=46">./spec/rspec/core/formatters/text_mate_formatter_spec.rb:46</a> </pre></div>
+ <pre class="ruby"><code><span class="linenum">24</span> <span class="keyword">rescue</span> <span class="constant">Exception</span>
+<span class="linenum">25</span> <span class="keyword">end</span>
+<span class="offending"><span class="linenum">26</span> <span class="keyword">raise</span> <span class="constant">RSpec</span><span class="punct">::</span><span class="constant">Core</span><span class="punct">::</span><span class="constant">PendingExampleFixedError</span><span class="punct">.</span><span class="ident">new</span> <span class="keyword">if</span> <span class="ident">result</span></span>
+<span class="linenum">27</span> <span class="keyword">end</span>
+<span class="linenum">28</span> <span class="keyword">raise</span> <span class="constant">PendingDeclaredInExample</span><span class="punct">.</span><span class="ident">new</span><span class="punct">(</span><span class="ident">message</span><span class="punct">)</span></code></pre>
</div>
</dd>
</dl>
@@ -357,8 +356,7 @@
<a href="txmt://open?url=file:///Users/david/projects/ruby/rspec2/repos/rspec-core/spec/rspec/core/formatters/text_mate_formatter_spec.rb&line=47">./spec/rspec/core/formatters/text_mate_formatter_spec.rb:47</a> :in `open'
<a href="txmt://open?url=file:///Users/david/projects/ruby/rspec2/repos/rspec-core/spec/rspec/core/formatters/text_mate_formatter_spec.rb&line=47">./spec/rspec/core/formatters/text_mate_formatter_spec.rb:47</a>
<a href="txmt://open?url=file:///Users/david/projects/ruby/rspec2/repos/rspec-core/spec/rspec/core/formatters/text_mate_formatter_spec.rb&line=46">./spec/rspec/core/formatters/text_mate_formatter_spec.rb:46</a> :in `chdir'
-<a href="txmt://open?url=file:///Users/david/projects/ruby/rspec2/repos/rspec-core/spec/rspec/core/formatters/text_mate_formatter_spec.rb&line=46">./spec/rspec/core/formatters/text_mate_formatter_spec.rb:46</a>
-:1</pre></div>
+<a href="txmt://open?url=file:///Users/david/projects/ruby/rspec2/repos/rspec-core/spec/rspec/core/formatters/text_mate_formatter_spec.rb&line=46">./spec/rspec/core/formatters/text_mate_formatter_spec.rb:46</a> </pre></div>
<pre class="ruby"><code><span class="linenum">27</span> <span class="keyword">end</span>
<span class="linenum">28</span>
<span class="offending"><span class="linenum">29</span> <span class="keyword">raise</span><span class="punct">(</span><span class="constant">RSpec</span><span class="punct">::</span><span class="constant">Expectations</span><span class="punct">::</span><span class="constant">ExpectationNotMetError</span><span class="punct">.</span><span class="ident">new</span><span class="punct">(</span><span class="ident">message</span><span class="punct">))</span></span>
@@ -385,7 +383,7 @@
<dd class="example failed">
<span class="failed_spec_name">fails with a backtrace containing an erb file</span>
<div class="failure" id="failure_4">
- <div class="message"><pre>#&lt;Class:01x1150b68&gt;</pre></div>
+ <div class="message"><pre>Exception</pre></div>
<div class="backtrace"><pre><a href="txmt://open?url=file:///foo.html.erb&line=1">/foo.html.erb:1</a> :in `<main>': foo (RuntimeError)</pre></div>
<pre class="ruby"><code><span class="linenum">-1</span><span class="comment"># Couldn't get snippet for /foo.html.erb</span></code></pre>
</div>
@@ -48,7 +48,13 @@ def e.backtrace
["/foo.html.erb:1:in `<main>': foo (RuntimeError)",
" from /lib/ruby/1.9.1/erb.rb:753:in `eval'"]
end
-
+
+ def e.message
+ # Redefining message steps around this behaviour
+ # on JRuby: http://jira.codehaus.org/browse/JRUBY-5637
+ self.class.name
+ end
+
raise e
end
end

0 comments on commit bd3aac8

Please sign in to comment.