spec/citeproc/ruby/renderer/group_spec.rb in citeproc-ruby-1.0.3 vs spec/citeproc/ruby/renderer/group_spec.rb in citeproc-ruby-1.0.4

- old
+ new

@@ -12,72 +12,72 @@ } let(:node) { CSL::Style::Group.new } it 'returns an empty string by default' do - renderer.render(item, node).should == '' + expect(renderer.render(item, node)).to eq('') node[:prefix] = '!' - renderer.render(item, node).should == '' + expect(renderer.render(item, node)).to eq('') end describe 'when there is a text node in the group' do before(:each) { node << CSL::Style::Text.new( :term => 'retrieved') } it 'returns the content of the nested node' do - renderer.render_group(item, node).should == 'retrieved' + expect(renderer.render_group(item, node)).to eq('retrieved') end it 'applies formatting options to the nested node' do node[:'text-case'] = 'uppercase' - renderer.render(item, node).should == 'RETRIEVED' + expect(renderer.render(item, node)).to eq('RETRIEVED') end describe 'when there is a second text node in the group' do before(:each) { node << CSL::Style::Text.new( :term => 'from') } it 'returns the content of both nested nodes' do - renderer.render_group(item, node).should == 'retrievedfrom' + expect(renderer.render_group(item, node)).to eq('retrievedfrom') end describe 'when there is a delimter set on the group node' do before(:each) { node[:delimiter] = ' ' } it 'applies the delimiter to the output' do - renderer.render_group(item, node).should == 'retrieved from' + expect(renderer.render_group(item, node)).to eq('retrieved from') end it 'applies formatting options to the nested nodes only' do node[:'text-case'] = 'uppercase' node[:delimiter] = ' foo ' node[:prefix] = '(' node[:suffix] = ')' - renderer.render(item, node).should == '(RETRIEVED foo FROM)' + expect(renderer.render(item, node)).to eq('(RETRIEVED FOO FROM)') end describe 'when a nested node produces no output' do before(:each) do node << CSL::Style::Text.new( :term => 'fooo') node << CSL::Style::Text.new( :term => 'from') end it 'the delimiter does not apply to it' do - renderer.render_group(item, node).should == 'retrieved from from' + expect(renderer.render_group(item, node)).to eq('retrieved from from') end end describe 'when there is a variable-based node in the group' do before(:each) { node << CSL::Style::Text.new( :variable => 'URL') } it 'returns the empty string when the variable is not present in the item' do - renderer.render_group(item, node).should == '' + expect(renderer.render_group(item, node)).to eq('') end describe 'when the variable is present' do before(:each) { item.data[:URL] = 'http://example.org' }; it 'returns all nested renditions' do - renderer.render_group(item, node).should == 'retrieved from http://example.org' + expect(renderer.render_group(item, node)).to eq('retrieved from http://example.org') end end end end end