Sha256: ed22e31d6a3ee5541dbadafa25e316ac604b4713f53b46fe56d8053b3b98d531
Contents?: true
Size: 683 Bytes
Versions: 17
Compression:
Stored size: 683 Bytes
Contents
require 'valise' require 'file-sandbox' describe Valise do include FileSandbox let :valise do sandbox.new :directory => "base/test" Valise::Set.define do handle "test/yaml-file", :yaml rw "base" end end let :item do valise.get("test/yaml-file").first end it "should store data as YAML" do item.contents = { :a => "test hash" } item.save YAML::load( File::read(item.full_path)).should == { :a => "test hash" } end it "should load data from YAML" do File::open(item.full_path, "w") do |file| file.write(YAML::dump( :another => "test hash" )) end item.contents.should == {:another => "test hash"} end end
Version data entries
17 entries across 17 versions & 1 rubygems