Sha256: f6eb3417d7dc331ff8485a7494912b6aa72e530ec396eb63d41b6df7ae7b73ef

Contents?: true

Size: 462 Bytes

Versions: 5

Compression:

Stored size: 462 Bytes

Contents

class Fixture
  class << self
    def load(name)
      case name
      when :sro_one_object,
           :sro_many_objects,
           :sro_many_objects_international,
           :sro_not_found
        read_file_for name
      else
        raise ArgumentError, "Fixture '#{name}' not found."
      end
    end

    private

    def read_file_for(filename)
      File.open("#{File.expand_path("../../", __FILE__)}/fixtures/#{filename}.xml").read
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
correios-sro-xml-0.4.0 spec/support/fixture.rb
correios-sro-xml-0.3.1 spec/support/fixture.rb
correios-sro-xml-0.3.0 spec/support/fixture.rb
correios-sro-xml-0.2.1 spec/support/fixture.rb
correios-sro-xml-0.2.0 spec/support/fixture.rb