spec/support/fixtures.rb in trackerific-0.6.2 vs spec/support/fixtures.rb in trackerific-0.7.0
- old
+ new
@@ -1,20 +1,6 @@
-# Provides easy access to XML fixtures
-module Fixtures
- # Gets the path to the fixtures
- # @return [String]
- # @api private
- def fixture_path
- File.join(File.dirname(__FILE__), "..", "fixtures")
- end
- # Loads a fixture
- # @param [Symbol] name the fixture to load
- # @param [Symbol] ext the exention of the fixture. defaults to :xml
- # @example Load ups_success_response.xml
- # response = load_fixture :ups_success_response
- # @return [String] the contents of the file
- # @api private
- def load_fixture(name, ext = :xml)
- file_name = File.join(fixture_path, "#{name.to_s}.#{ext.to_s}")
- File.read(file_name)
+class Fixture
+ def self.read(name)
+ fixtures_path = File.expand_path("../../fixtures", __FILE__)
+ File.read(File.join(fixtures_path, name))
end
end