spec/command/rebind_spec.rb in retter-0.1.0 vs spec/command/rebind_spec.rb in retter-0.1.1

- old
+ new

@@ -7,11 +7,11 @@ let(:wip_file) { retter_config.wip_file } let(:date_file) { retter_config.retter_file(Date.parse(date_str)) } let(:date_html) { retter_config.entry_file(Date.parse(date_str)) } before do - command.stub!(:config) { retter_config } + Retter.stub!(:config) { retter_config } end context 'first post' do let(:date_str) { '20110101' } let(:article) { <<-EOM } @@ -39,27 +39,27 @@ describe 'index.html' do let(:index_html) { retter_config.index_file.read } it { texts_of(index_html, 'article p').should include('おはようございます') } - it { texts_of(index_html, 'article h1.date').should == %w(2011/01/01) } - it { texts_of(index_html, 'article h1').should == %w(2011/01/01 朝11時 夜1時) } + it { texts_of(index_html, 'article h1.date').should == %w(2011-01-01) } + it { texts_of(index_html, 'article h1').should == %w(2011-01-01 朝11時 夜1時) } end describe 'entries.html' do let(:entries_html) { retter_config.entries_file.read } - it { texts_of(entries_html, 'a.entry').first.should == '2011/01/01' } + it { texts_of(entries_html, 'a.entry').first.should == '2011-01-01' } it { texts_of(entries_html, 'a.title').should == %w(朝11時 夜1時) } end describe 'entry.html' do let(:entry_html) { retter_config.entry_file(Date.parse(date_str)).read } it { texts_of(entry_html, 'article p').should == %w(おはようございます おやすみなさい) } - it { texts_of(entry_html, 'article h1.date').should == %w(2011/01/01) } - it { texts_of(entry_html, 'article h1').should == %w(2011/01/01 朝11時 夜1時) } + it { texts_of(entry_html, 'article h1.date').should == %w(2011-01-01) } + it { texts_of(entry_html, 'article h1').should == %w(2011-01-01 朝11時 夜1時) } end describe 'entry part(first)' do let(:part_html) { retter_config.entry_dir(Date.parse(date_str)).join('a0.html').read } @@ -69,11 +69,11 @@ it { should_not include('おやすみなさい') } end describe 'date' do subject { texts_of(part_html, 'article h1.date') } - it { should == %w(2011/01/01) } + it { should == %w(2011-01-01) } end describe 'headings' do subject { texts_of(part_html, 'article h1') } it { should include('朝11時') } @@ -90,10 +90,10 @@ it { should_not include('おはようございます') } end describe 'date' do subject { texts_of(part_html, 'article h1.date') } - it { should == %w(2011/01/01) } + it { should == %w(2011-01-01) } end describe 'headings' do subject { texts_of(part_html, 'article h1') } it { should include('夜1時') }