multi_xml 0.5.5 → 0.7.0

Sign up to get free protection for your applications and to get access to all the features.
data/spec/helper.rb DELETED
@@ -1,17 +0,0 @@
1
- require 'simplecov'
2
- require 'coveralls'
3
-
4
- SimpleCov.formatter = SimpleCov::Formatter::MultiFormatter[
5
- SimpleCov::Formatter::HTMLFormatter,
6
- Coveralls::SimpleCov::Formatter
7
- ]
8
- SimpleCov.start
9
-
10
- require 'multi_xml'
11
- require 'rspec'
12
-
13
- RSpec.configure do |config|
14
- config.expect_with :rspec do |c|
15
- c.syntax = :expect
16
- end
17
- end
@@ -1,43 +0,0 @@
1
- require 'helper'
2
- require 'parser_shared_example'
3
-
4
- class MockDecoder; end
5
-
6
- describe "MultiXml" do
7
- context "Parsers" do
8
- it "picks a default parser" do
9
- expect(MultiXml.parser).to be_kind_of(Module)
10
- expect(MultiXml.parser).to respond_to(:parse)
11
- end
12
-
13
- it "defaults to the best available gem" do
14
- # Clear cache variable already set by previous tests
15
- MultiXml.send(:remove_instance_variable, :@parser)
16
- expect(MultiXml.parser.name).to eq('MultiXml::Parsers::Ox')
17
- end
18
-
19
- it "is settable via a symbol" do
20
- MultiXml.parser = :rexml
21
- expect(MultiXml.parser.name).to eq('MultiXml::Parsers::Rexml')
22
- end
23
-
24
- it "is settable via a class" do
25
- MultiXml.parser = MockDecoder
26
- expect(MultiXml.parser.name).to eq('MockDecoder')
27
- end
28
- end
29
-
30
- [['LibXML', 'libxml'],
31
- ['REXML', 'rexml/document'],
32
- ['Nokogiri', 'nokogiri'],
33
- ['Ox', 'ox']].each do |parser|
34
- begin
35
- require parser.last
36
- context "#{parser.first} parser" do
37
- it_behaves_like "a parser", parser.first
38
- end
39
- rescue LoadError => e
40
- puts "Tests not run for #{parser.first} due to a LoadError"
41
- end
42
- end
43
- end