Sha256: 2f42fa53207dc162ffa8ac5a824a8af4500daad641e570dd9f6bc80c625d3149

Contents?: true

Size: 1.17 KB

Versions: 50

Compression:

Stored size: 1.17 KB

Contents

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

50 entries across 50 versions & 1 rubygems

Version Path
vedeu-0.6.57 test/lib/vedeu/application/application_view_test.rb
vedeu-0.6.56 test/lib/vedeu/application/application_view_test.rb
vedeu-0.6.54 test/lib/vedeu/application/application_view_test.rb
vedeu-0.6.53 test/lib/vedeu/application/application_view_test.rb
vedeu-0.6.52 test/lib/vedeu/application/application_view_test.rb
vedeu-0.6.51 test/lib/vedeu/application/application_view_test.rb
vedeu-0.6.50 test/lib/vedeu/application/application_view_test.rb
vedeu-0.6.49 test/lib/vedeu/application/application_view_test.rb
vedeu-0.6.48 test/lib/vedeu/application/application_view_test.rb
vedeu-0.6.47 test/lib/vedeu/application/application_view_test.rb
vedeu-0.6.46 test/lib/vedeu/application/application_view_test.rb
vedeu-0.6.45 test/lib/vedeu/application/application_view_test.rb
vedeu-0.6.44 test/lib/vedeu/application/application_view_test.rb
vedeu-0.6.43 test/lib/vedeu/application/application_view_test.rb
vedeu-0.6.42 test/lib/vedeu/application/application_view_test.rb
vedeu-0.6.41 test/lib/vedeu/application/application_view_test.rb
vedeu-0.6.40 test/lib/vedeu/application/application_view_test.rb
vedeu-0.6.39 test/lib/vedeu/application/application_view_test.rb
vedeu-0.6.38 test/lib/vedeu/application/application_view_test.rb
vedeu-0.6.37 test/lib/vedeu/application/application_view_test.rb