Sha256: 332194a7c353adf23e304e3887c68cce6e87181511b834a8fad86b173831d6b5

Contents?: true

Size: 704 Bytes

Versions: 5

Compression:

Stored size: 704 Bytes

Contents

require "spec_helper"

describe JsonSpec::Memory do
  it "has a memory" do
    JsonSpec.memory.should == {}
  end

  it "memorizes strings" do
    JsonSpec.memorize(:key, "value")
    JsonSpec.memory.should == {:key => "value"}
  end

  it "symbolizes keys" do
    JsonSpec.memorize("key", "value")
    JsonSpec.memory.should == {:key => "value"}
  end

  it "regurgitates unremembered strings" do
    JsonSpec.remember("foo%{bar}").should == "foo%{bar}"
  end

  it "remembers strings" do
    JsonSpec.memorize(:bar, "baz")
    JsonSpec.remember("foo%{bar}").should == "foobaz"
  end

  it "forgets" do
    JsonSpec.memorize(:key, "value")
    JsonSpec.forget
    JsonSpec.memory.should == {}
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
json_spec-1.1.1 spec/json_spec/memory_spec.rb
json_spec-1.1.0 spec/json_spec/memory_spec.rb
json_spec-1.0.3 spec/json_spec/memory_spec.rb
json_spec-1.0.2 spec/json_spec/memory_spec.rb
json_spec-1.0.0 spec/json_spec/memory_spec.rb