Skip to content

Commit

Permalink
added rescue to protect against stale method source weirdness
Browse files Browse the repository at this point in the history
  • Loading branch information
Michael Crismali committed Dec 28, 2014
1 parent f99c101 commit 7c57991
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
9 changes: 6 additions & 3 deletions app/views/magic_lamp/lint/fixture_errors.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,12 @@
<p>Controller: <%= fixture_info[:controller] %></p>
<p>Extensions: <%= fixture_info[:extend].present? ? fixture_info[:extend].join(", ") : "None" %></p>
<p>Source Code:
<p><% render_block.source.split("\n").each do |line| %>
<div style="text-indent: <%= line.match(/\A\s+/).to_s.size %>em;"><%= line %></div>
<% end %></p>
<p>
<% source_code = render_block.source rescue "" %>
<% source_code.split("\n").each do |line| %>
<div style="text-indent: <%= line.match(/\A\s+/).to_s.size %>em;"><%= line %></div>
<% end %>
</p>
</p>
<p class="error">Error: <%= fixture_info[:error] %></p>
</div>
Expand Down
1 change: 0 additions & 1 deletion example/spec/javascripts/magic_lamp/magic_lamp_config.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ def current_user
end

MagicLamp.configure do |config|

DatabaseCleaner.strategy = :transaction

config.before_each do
Expand Down

0 comments on commit 7c57991

Please sign in to comment.