Sha256: 585462c985c93bc56c7ae6ca01ef870721fa56da73ca6f8f1cae5f7fc811bda6

Contents?: true

Size: 669 Bytes

Versions: 81

Compression:

Stored size: 669 Bytes

Contents

require "spec_helper"

describe "Hashing" do
  let(:doc) { Brief.concept_document }

  it "has a content hash" do
    expect(doc.content_hash).not_to be_empty
  end

  it "has a file system hash" do
    expect(doc.file_hash).not_to be_empty
  end

  it "detects when it is stale" do
    new_content = doc.content += "\n\n1";
    doc.path.open("w+") {|fh| fh.write("---\ntype: concept\n\n---\n\n#{new_content}") }
    expect(doc).to be_content_stale
  end

  it "refreshes itself if stale" do
    new_content = doc.content += "\n\n1";
    doc.path.open("w+") {|fh| fh.write("---\ntype: concept\n\n---\n\n#{new_content}") }
    expect(doc).to be_content_stale
  end

end

Version data entries

81 entries across 81 versions & 1 rubygems

Version Path
brief-1.17.14 spec/lib/brief/hashing_spec.rb
brief-1.17.13 spec/lib/brief/hashing_spec.rb
brief-1.17.12 spec/lib/brief/hashing_spec.rb
brief-1.17.11 spec/lib/brief/hashing_spec.rb
brief-1.17.10 spec/lib/brief/hashing_spec.rb
brief-1.17.9 spec/lib/brief/hashing_spec.rb
brief-1.17.8 spec/lib/brief/hashing_spec.rb
brief-1.17.7 spec/lib/brief/hashing_spec.rb
brief-1.17.5 spec/lib/brief/hashing_spec.rb
brief-1.17.4 spec/lib/brief/hashing_spec.rb
brief-1.17.3 spec/lib/brief/hashing_spec.rb
brief-1.17.2 spec/lib/brief/hashing_spec.rb
brief-1.17.1 spec/lib/brief/hashing_spec.rb
brief-1.17.0 spec/lib/brief/hashing_spec.rb
brief-1.16.2 spec/lib/brief/hashing_spec.rb
brief-1.16.1 spec/lib/brief/hashing_spec.rb
brief-1.16.0 spec/lib/brief/hashing_spec.rb
brief-1.15.5 spec/lib/brief/hashing_spec.rb
brief-1.15.4 spec/lib/brief/hashing_spec.rb
brief-1.15.3 spec/lib/brief/hashing_spec.rb