Sha256: 50dc993d58406c1e47450483eb491141337f80be8cce11d6fd00bff390d4b57f

Contents?: true

Size: 391 Bytes

Versions: 5

Compression:

Stored size: 391 Bytes

Contents

##
# FixtureHelper
#
# Helps with doing inline fixtures for JSON strings
#
module FixtureHelper
  def self.included(base)
    base.extend ClassMethods
  end
  
  module ClassMethods
    def json_fixture(&block)
      before :all do
        @json = yield
        @fixture = JSON.parse(@json)
      end
      
      after :all do
        @json, @fixture = nil, nil
      end
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
npr-1.2.0 spec/support/fixture_helper.rb
npr-1.1.0 spec/support/fixture_helper.rb
npr-0.1.2 spec/support/fixture_helper.rb
npr-0.1.1 spec/support/fixture_helper.rb
npr-0.1.0 spec/support/fixture_helper.rb