Skip to content

Commit

Permalink
Dry up templates
Browse files Browse the repository at this point in the history
  • Loading branch information
jnicklas committed Oct 3, 2011
1 parent 7181842 commit c253097
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 38 deletions.
4 changes: 2 additions & 2 deletions lib/evergreen/application.rb
Expand Up @@ -49,15 +49,15 @@ def render_spec(spec)
@suite = Evergreen::Suite.new
@js_spec_helper = @suite.get_spec('spec_helper.js')
@coffee_spec_helper = @suite.get_spec('spec_helper.coffee')
erb :all
erb :run
end

get '/run/*' do |name|
@suite = Evergreen::Suite.new
@spec = @suite.get_spec(name)
@js_spec_helper = @suite.get_spec('spec_helper.js')
@coffee_spec_helper = @suite.get_spec('spec_helper.coffee')
erb :spec
erb :run
end
end
end
Expand Down
12 changes: 8 additions & 4 deletions lib/evergreen/views/all.erb → lib/evergreen/views/run.erb
Expand Up @@ -5,10 +5,14 @@
// <![CDATA[
<%= render_spec(@coffee_spec_helper) %>;
<%= render_spec(@js_spec_helper) %>;
<% @suite.specs.each do |spec| %>
describe("<%= spec.name %>", function() {
<%= render_spec(spec) %>;
});
<% if @spec %>
<%= render_spec(@spec) %>
<% else %>
<% @suite.specs.each do |spec| %>
describe("<%= spec.name %>", function() {
<%= render_spec(spec) %>;
});
<% end %>
<% end %>
// ]]>
</script>
Expand Down
32 changes: 0 additions & 32 deletions lib/evergreen/views/spec.erb

This file was deleted.

0 comments on commit c253097

Please sign in to comment.