Sha256: 86b3dafd38bb0514d3d5f9cec050c9ba15253838cc8846e08f81d576efe45847

Contents?: true

Size: 611 Bytes

Versions: 6

Compression:

Stored size: 611 Bytes

Contents

module SpecSupport

  class Fixture
    def self.[](name)
      fixtures[name]
    end

    def self.[]=(name, value)
      fixtures[name] = value
    end

    def self.fixtures
      @fixtures ||= {}
    end

    def initialize(file, ext = :wsdl)
      self.file = file
      self.ext = ext
    end

    attr_accessor :file, :ext

    def filename
      "#{file}.#{ext}"
    end

    def path
      File.expand_path("spec/fixtures/#{filename}")
    end

    def read
      Fixture[filename] ||= File.read(path)
    end
  end

  module Methods
    def fixture(*args)
      Fixture.new(*args)
    end
  end

end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
wasabi-3.1.0 spec/support/fixture.rb
wasabi-3.0.0 spec/support/fixture.rb
wasabi-2.5.1 spec/support/fixture.rb
wasabi-2.5.0 spec/support/fixture.rb
wasabi-2.4.1 spec/support/fixture.rb
wasabi-2.4.0 spec/support/fixture.rb