Permalink
Browse files

Instead of using template.html.erb use index.erb, simpler and better

  • Loading branch information...
1 parent e2b30a0 commit 5a335fbc9bb9d8390c359794534997cc62b8a062 @alloy alloy committed Mar 5, 2009
View
@@ -57,5 +57,9 @@ task :generate_repo_fixture_archive do
archive = "#{repo}.tgz"
rm_rf File.join(fixtures, archive)
+
+ sh "cd '#{File.join(fixtures, repo)}' && git add . && git commit -a -m 'Regenerating repo fixture'"
sh "cd '#{fixtures}' && tar czf #{archive} #{repo}"
+
+ rm_rf 'test/tmp'
end
@@ -19,7 +19,7 @@ def initialize(account, repo = nil)
@repo = repo
@index = ReposIndex.new(@account, (Dir.pwd unless @repo))
- @html_template = template(Template::HTML, 'template.html.erb')
+ @html_template = template(Template::HTML, 'index.erb')
@feed_template = template(Template::Feed, 'feed.rb')
@index.add(@repo) if @repo
Binary file not shown.
File renamed without changes.
File renamed without changes.
@@ -45,7 +45,7 @@
it "should return the html template" do
template = @portfolio.html_template
template.should.be.instance_of JewelryPortfolio::Template::HTML
- template.file.should == File.join(@portfolio.index.path, 'template.html.erb')
+ template.file.should == File.join(@portfolio.index.path, 'index.erb')
template.account.should == 'alloy'
template.repos.should == @portfolio.index.repos.to_a.sort_by { |r| r.name }
end
@@ -64,7 +64,7 @@
expected_feed = File.read(fixture('feed_with_options.xml')).gsub('TIME_NOW', time.iso8601)
@portfolio.render!
- File.read(File.join(@portfolio.index.path, 'index.html')).should == File.read(fixture('template.html'))
+ File.read(File.join(@portfolio.index.path, 'index.html')).should == File.read(fixture('index.html'))
File.read(File.join(@portfolio.index.path, 'feed.xml')).should == expected_feed
end
@@ -34,7 +34,7 @@ def self.included(klass)
@repos = %w{ dr-nic-magic-awesome.gemspec_ microgem.gemspec_ }.
map { |spec| JewelryPortfolio::Repo.new('alloy', fixture_eval(spec)) }
- @file = fixture('template.html.erb')
+ @file = fixture('index.erb')
@template = JewelryPortfolio::Template::HTML.new(@file, 'alloy', @repos.to_set)
end
@@ -46,7 +46,7 @@ def self.included(klass)
end
it "should render the ERB template" do
- @template.render.should == File.read(fixture('template.html'))
+ @template.render.should == File.read(fixture('index.html'))
end
it "should return the repos ordered by name" do

0 comments on commit 5a335fb

Please sign in to comment.