# -*- 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