Sha256: 53da4b2e957bcbc1b03afee9eb232f114327174f98dd47370580eaf511fc11a1

Contents?: true

Size: 901 Bytes

Versions: 37

Compression:

Stored size: 901 Bytes

Contents

require 'test_helper'

module Vedeu

  module Templating

    describe Directive do

      let(:described) { Vedeu::Templating::Directive }
      let(:instance)  { described.new(code) }
      let(:code) {
        "colour(foreground: '#0f0') { 'Yay!' }"
      }

      describe '#initialize' do
        it { instance.must_be_instance_of(described) }
        it { instance.instance_variable_get('@code').must_equal(code) }
      end

      describe '.process' do
        it { described.must_respond_to(:process) }
      end

      describe '#process' do
        let(:colour)   { Vedeu::Colour.coerce(foreground: '#0f0') }
        let(:expected) { Vedeu::Stream.new(value: 'Yay!', colour: colour) }

        subject { instance.process }

        it { subject.must_be_instance_of(Vedeu::Stream) }
        it { subject.must_equal(expected) }
      end

    end # Directive

  end # Templating

end # Vedeu

Version data entries

37 entries across 37 versions & 1 rubygems

Version Path
vedeu-0.4.64 test/lib/vedeu/templating/directive_test.rb
vedeu-0.4.63 test/lib/vedeu/templating/directive_test.rb
vedeu-0.4.62 test/lib/vedeu/templating/directive_test.rb
vedeu-0.4.61 test/lib/vedeu/templating/directive_test.rb
vedeu-0.4.60 test/lib/vedeu/templating/directive_test.rb
vedeu-0.4.59 test/lib/vedeu/templating/directive_test.rb
vedeu-0.4.58 test/lib/vedeu/templating/directive_test.rb
vedeu-0.4.57 test/lib/vedeu/templating/directive_test.rb
vedeu-0.4.56 test/lib/vedeu/templating/directive_test.rb
vedeu-0.4.55 test/lib/vedeu/templating/directive_test.rb
vedeu-0.4.54 test/lib/vedeu/templating/directive_test.rb
vedeu-0.4.53 test/lib/vedeu/templating/directive_test.rb
vedeu-0.4.52 test/lib/vedeu/templating/directive_test.rb
vedeu-0.4.51 test/lib/vedeu/templating/directive_test.rb
vedeu-0.4.50 test/lib/vedeu/templating/directive_test.rb
vedeu-0.4.49 test/lib/vedeu/templating/directive_test.rb
vedeu-0.4.48 test/lib/vedeu/templating/directive_test.rb
vedeu-0.4.47 test/lib/vedeu/templating/directive_test.rb
vedeu-0.4.46 test/lib/vedeu/templating/directive_test.rb
vedeu-0.4.45 test/lib/vedeu/templating/directive_test.rb