Sha256: b667711bcbb3d60315d676a65fb2ec3e26942544a29cdbe6b2add91eaf81d5ac

Contents?: true

Size: 1.75 KB

Versions: 24

Compression:

Stored size: 1.75 KB

Contents

require "spec_helper"

describe "The Briefcase" do
  let(:briefcase) { Brief.testcase }

  it "has a root path" do
    expect(briefcase.root).to be_exist
  end

  it "has a cache key" do
    expect(briefcase.cache_key).not_to be_nil
  end

  it "has a slug" do
    expect(briefcase.slug).to eq("example")
  end

  it "has settings" do
    expect(briefcase.settings).not_to be_empty
  end

  # TODO
  # This is dependent on the blueprint app
  # should be refactored
  it "has a table of contents" do
    expect(briefcase.table_of_contents).to be_present
    expect(briefcase.table_of_contents.headings).not_to be_empty
  end

  it "loads the files defined in the lib folder" do
    expect(briefcase.briefcase_lib_path.entries).not_to be_empty
    expect(defined?(ShouldBeDefined)).to be_truthy
  end

  it "points to a file repository" do
    expect(briefcase.repository).to be_a(Brief::Repository)
  end

  it "defines methods which combine models in arbitrary ways" do
    expect(briefcase.custom_aggregator).to be_a(Hash)
  end

  it "reads the settings.yml" do
    expect(briefcase.settings.settings).to be_present
  end

  # Need to improve this
  context "Model Loading" do
    it "loads the model definitions from the models and the apps folder" do
      expect(Brief::Model.classes).not_to be_empty
    end

    it "loads the model definitions from the DSL in the config file" do
      expect(Brief::Model.classes).not_to be_empty
    end

    it "caches the output" do
      object_id = briefcase.epics.object_id
      expect(briefcase.epics.object_id).to eq(object_id)
    end
  end

  context "Document Mappings" do
    it "has all of the documents" do
      expect(briefcase.epics.length).to eq(1)
      expect(briefcase.documents.length).to be_greater_than(9)
    end
  end
end

Version data entries

24 entries across 24 versions & 1 rubygems

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