spec/csl/parser_spec.rb in csl-1.2.3 vs spec/csl/parser_spec.rb in csl-1.3.0
- old
+ new
@@ -26,11 +26,11 @@
it 'returns a node with nodename "foo"' do
expect(Parser.instance.parse(source).nodename).to eq('foo')
end
it 'returns a node with no attributes' do
- expect(Parser.instance.parse(source)).not_to have_attributes
+ expect(Parser.instance.parse(source).attributes).to be_empty
end
it 'returns a node with no children' do
expect(Parser.instance.parse(source)).not_to have_children
end
@@ -55,29 +55,29 @@
end
end
end
describe 'for <foo bar="x"/>' do
- let(:source) { '<foo bar="x"/>' }
+ let(:src) { '<foo bar="x"/>' }
it 'returns a node with attributes' do
- expect(Parser.instance.parse(source)).to have_attributes
+ expect(Parser.instance.parse(src).attributes).not_to be_empty
end
it 'returns a node with attribute bar' do
- expect(Parser.instance.parse(source).attribute?(:bar)).to be
+ expect(Parser.instance.parse(src).attribute?(:bar)).to be
end
it 'bar should be "x"' do
- expect(Parser.instance.parse(source)[:bar]).to eq('x')
+ expect(Parser.instance.parse(src)[:bar]).to eq('x')
end
end
describe 'for <foo>Foo Bar</foo>' do
- let(:source) { '<foo>Foo Bar</foo>' }
+ let(:src) { '<foo>Foo Bar</foo>' }
it 'returns text node' do
- expect(Parser.instance.parse(source)).to be_textnode
+ expect(Parser.instance.parse(src)).to be_textnode
end
end
it 'returns a regular node for <x>\n <y/></x>' do
expect(Parser.instance.parse("<x>\n <y/></x>")).not_to be_textnode