Sha256: 12251094e8d28b43c26bcfbdd7967130b66f3bd6f1d4bbb31b4df0c5aefe9c94

Contents?: true

Size: 874 Bytes

Versions: 6

Compression:

Stored size: 874 Bytes

Contents

# frozen_string_literal: true

require 'test_helper'

module Vedeu

  module Coercers

    describe Lines do

      let(:described) { Vedeu::Coercers::Lines }
      let(:instance)  { described.new(_value) }
      let(:_value)    {}
      let(:klass)     { Vedeu::Views::Lines }

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

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

      describe '#coerce' do
        subject { instance.coerce }

        context 'when the value is already the target class' do
          let(:_value) { klass.new }

          it { subject.must_be_instance_of(klass) }
          it { subject.must_equal(_value) }
        end
      end

    end # Lines

  end # Coercers

end # Vedeu

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
vedeu-0.8.15 test/lib/vedeu/coercers/lines_test.rb
vedeu-0.8.14 test/lib/vedeu/coercers/lines_test.rb
vedeu-0.8.13 test/lib/vedeu/coercers/lines_test.rb
vedeu-0.8.12 test/lib/vedeu/coercers/lines_test.rb
vedeu-0.8.10 test/lib/vedeu/coercers/lines_test.rb
vedeu-0.8.9 test/lib/vedeu/coercers/lines_test.rb