Fingertips-jewelry_portfolio 0.3.0 → 0.3.1
Sign up to get free protection for your applications and to get access to all the features.
- data/VERSION.yml +1 -1
- data/lib/jewelry_portfolio.rb +2 -2
- data/lib/jewelry_portfolio/repos_index.rb +1 -1
- data/test/jewelry_portfolio_test.rb +9 -5
- metadata +1 -1
data/VERSION.yml
CHANGED
data/lib/jewelry_portfolio.rb
CHANGED
@@ -19,10 +19,10 @@ class JewelryPortfolio
|
|
19
19
|
@repo = repo
|
20
20
|
@index = ReposIndex.new(@account, (Dir.pwd unless @repo))
|
21
21
|
|
22
|
+
@index.add(@repo) if @repo
|
23
|
+
|
22
24
|
@html_template = template(Template::HTML, 'index.erb')
|
23
25
|
@feed_template = template(Template::Feed, 'feed.rb')
|
24
|
-
|
25
|
-
@index.add(@repo) if @repo
|
26
26
|
end
|
27
27
|
|
28
28
|
# Renders the index.html file.
|
@@ -7,7 +7,7 @@ describe "JewelryPortfolio" do
|
|
7
7
|
JewelryPortfolio::ReposIndex.any_instance.stubs(:puts)
|
8
8
|
FileUtils.rm_rf(TMP_PAGES_REPO)
|
9
9
|
|
10
|
-
@repo = JewelryPortfolio::Repo.new('alloy', eval(fixture_read('dr-nic-magic-awesome.gemspec_')))
|
10
|
+
@repo = JewelryPortfolio::Repo.new('alloy', eval(fixture_read('dr-nic-magic-awesome.gemspec_').gsub('1.0.0', '1.1.1')))
|
11
11
|
@portfolio = JewelryPortfolio.new('alloy', @repo)
|
12
12
|
|
13
13
|
@portfolio.stubs(:puts)
|
@@ -58,19 +58,23 @@ describe "JewelryPortfolio" do
|
|
58
58
|
template.repos.should == @portfolio.index.repos.to_a.sort
|
59
59
|
end
|
60
60
|
|
61
|
-
it "should write out the template and feed" do
|
61
|
+
it "should write out the template and feed files with the new repo" do
|
62
62
|
time = Time.now
|
63
63
|
Time.stubs(:now).returns(time)
|
64
64
|
expected_feed = File.read(fixture('feed_with_options.xml')).gsub('TIME_NOW', time.iso8601)
|
65
65
|
|
66
66
|
@portfolio.render!
|
67
|
-
|
68
|
-
File.read(File.join(@portfolio.index.path, '
|
67
|
+
|
68
|
+
rendered_html = File.read(File.join(@portfolio.index.path, 'index.html')).gsub('1.1.1', '1.0.0')
|
69
|
+
rendered_feed = File.read(File.join(@portfolio.index.path, 'feed.xml')).gsub('1.1.1', '1.0.0')
|
70
|
+
|
71
|
+
rendered_html.should == File.read(fixture('index.html'))
|
72
|
+
rendered_feed.should == expected_feed
|
69
73
|
end
|
70
74
|
|
71
75
|
it "should render, commit, and push the master branch" do
|
72
76
|
@portfolio.expects(:render!)
|
73
|
-
@portfolio.index.expects(:commit!).with("Updated github pages for: dr-nic-magic-awesome-1.
|
77
|
+
@portfolio.index.expects(:commit!).with("Updated github pages for: dr-nic-magic-awesome-1.1.1")
|
74
78
|
@portfolio.index.expects(:push!)
|
75
79
|
|
76
80
|
@portfolio.release!
|