Sha256: 8070538abf71f5f4103194394949e307b0b22a5c5f9d1ad38d8a1fe4a658db08

Contents?: true

Size: 1.11 KB

Versions: 1

Compression:

Stored size: 1.11 KB

Contents

module IniParse
  module Test
    class Fixtures
      @@fixtures = {}

      def self.[](fix)
        if @@fixtures.has_key?(fix)
          @@fixtures[fix]
        else
          @@fixtures[fix] = File.read(
            File.join(File.expand_path('fixtures', File.dirname(__FILE__)), fix)
          )
        end
      end

      def self.[]=(fix, val)
        @@fixtures[fix] = val
      end
    end
  end
end

IniParse::Test::Fixtures[:comment_before_section] = <<-FIX.gsub(/^  /, '')
  ; This is a comment
  [first_section]
  key = value
FIX

IniParse::Test::Fixtures[:blank_before_section] = <<-FIX.gsub(/^  /, '')

  [first_section]
  key = value
FIX

IniParse::Test::Fixtures[:blank_in_section] = <<-FIX.gsub(/^  /, '')
  [first_section]

  key = value
FIX

IniParse::Test::Fixtures[:option_before_section] = <<-FIX.gsub(/^  /, '')
  key = value
  [first_section]
FIX

IniParse::Test::Fixtures[:invalid_line] = <<-FIX.gsub(/^  /, '')
  this line is not valid
FIX

IniParse::Test::Fixtures[:section_with_equals] = <<-FIX.gsub(/^  /, '')
  [first_section = name]
  key = value
  [another_section = a name]
  another = thing
FIX

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
iniparse-1.1.5 spec/spec_fixtures.rb