Sha256: cf5765ad8928d691176742ea02054c4f11bd8ca6618b7f577f0bdd6e8dd5cd6e

Contents?: true

Size: 1.2 KB

Versions: 31

Compression:

Stored size: 1.2 KB

Contents

# frozen_string_literal: true

require 'test_helper'

module Vedeu

  describe ApplicationView do

    let(:described) { Vedeu::ApplicationView }
    let(:instance)  { described.new(params) }
    let(:params)    { {} }

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

      context 'defined methods' do
        let(:params) {
          {
            elements: [:hydrogen, :helium]
          }
        }

        it { instance.must_respond_to(:elements) }
        it { instance.elements.must_equal(params[:elements]) }

        context 'but the params contain a key already defined as a method' do
          let(:params) {
            {
              render: [:some_value]
            }
          }

          it { instance.must_respond_to(:render) }
          it { proc { instance.render }.wont_equal(params[:render]) }
        end
      end
    end

    describe '.render' do
      subject { described.render(params) }

      it { proc { subject }.must_raise(Vedeu::Error::NotImplemented) }
    end

    describe '#render' do
      it { instance.must_respond_to(:render) }
    end

  end # ApplicationView

end # Vedeu

Version data entries

31 entries across 31 versions & 1 rubygems

Version Path
vedeu-0.8.32 test/lib/vedeu/application/application_view_test.rb
vedeu-0.8.31 test/lib/vedeu/application/application_view_test.rb
vedeu-0.8.30 test/lib/vedeu/application/application_view_test.rb
vedeu-0.8.29 test/lib/vedeu/application/application_view_test.rb
vedeu-0.8.28 test/lib/vedeu/application/application_view_test.rb
vedeu-0.8.27 test/lib/vedeu/application/application_view_test.rb
vedeu-0.8.26 test/lib/vedeu/application/application_view_test.rb
vedeu-0.8.25 test/lib/vedeu/application/application_view_test.rb
vedeu-0.8.24 test/lib/vedeu/application/application_view_test.rb
vedeu-0.8.23 test/lib/vedeu/application/application_view_test.rb
vedeu-0.8.22 test/lib/vedeu/application/application_view_test.rb
vedeu-0.8.21 test/lib/vedeu/application/application_view_test.rb
vedeu-0.8.20 test/lib/vedeu/application/application_view_test.rb
vedeu-0.8.19 test/lib/vedeu/application/application_view_test.rb
vedeu-0.8.18 test/lib/vedeu/application/application_view_test.rb
vedeu-0.8.17 test/lib/vedeu/application/application_view_test.rb
vedeu-0.8.16 test/lib/vedeu/application/application_view_test.rb
vedeu-0.8.15 test/lib/vedeu/application/application_view_test.rb
vedeu-0.8.14 test/lib/vedeu/application/application_view_test.rb
vedeu-0.8.13 test/lib/vedeu/application/application_view_test.rb