Sha256: 3e4c2d77b250a4edc319d0613db9412423b94dfd7c1377d2e72c8c3322940b61

Contents?: true

Size: 1.09 KB

Versions: 1

Compression:

Stored size: 1.09 KB

Contents

# -*- encoding : utf-8 -*-
require 'spec_helper'

describe AssetsLedger::Ledger do
  let(:ledger)      { described_class.new }
  let(:string_dep)  { 'page/test' }
  let(:string_dep1) { 'page/test1' }

  it 'adds library to list' do
    expect(ledger.add_js(string_dep)).to eq(Set.new [string_dep])
  end

  it 'adds nothing if nil is passed as an argument' do
    expect(ledger.add_js(nil)).to eq(Set.new [])
  end

  it 'adds library to list with multiple arguments' do
    expect(ledger.add_js(string_dep, string_dep1)).to eq(Set.new [string_dep, string_dep1])
  end

  it 'adds library to list with argument as list' do
    expect(ledger.add_js([string_dep, string_dep1])).to eq(Set.new [string_dep, string_dep1])
  end

  it 'has method to add css dependencies' do
    expect(ledger.add_css(string_dep)).to eq(Set.new [string_dep])
  end

  it 'returns js dependencies as list' do
    ledger.add_js(string_dep)
    expect(ledger.js_dependencies).to eq([string_dep])
  end

  it 'returns css dependencies as list' do
    ledger.add_css(string_dep)
    expect(ledger.css_dependencies).to eq([string_dep])
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
assets_ledger-0.0.2 spec/assets_ledger/ledger_spec.rb