Sha256: 7f9de18cd916f462412e4320eb447ac46006f5f128dcaa90f527fb8962177ab0
Contents?: true
Size: 1.73 KB
Versions: 1
Compression:
Stored size: 1.73 KB
Contents
require 'test_helper' module Vedeu module DSL describe View do let(:described) { Vedeu::DSL::View } let(:instance) { described.new(model) } let(:model) { Vedeu::Views::Composition.new } let(:client) {} describe '#view' do subject { instance.view('dysprosium') do # ... end } it { subject.must_be_instance_of(Vedeu::Views::Views) } it { subject[0].must_be_instance_of(Vedeu::Views::View) } context 'when the block is not given' do it { proc { instance.view }.must_raise(Vedeu::Error::RequiresBlock) } end end describe '#template_for' do let(:_name) {} let(:filename) {} let(:object) {} let(:content) { "Hydrogen\nCarbon\nOxygen\nNitrogen" } let(:options) { {} } subject { instance.template_for(_name, filename, object, options) } context 'when the name of the view is not given' do let(:filename) { 'my_interface.erb' } it { proc { subject }.must_raise(Vedeu::Error::MissingRequired) } end context 'when the filename of the template is not given' do let(:_name) { 'my_interface' } it { proc { subject }.must_raise(Vedeu::Error::MissingRequired) } end context 'when the name and filename are given' do let(:_name) { 'my_interface' } let(:filename) { 'my_interface.erb' } before do Vedeu::Templating::ViewTemplate.expects(:parse). with(object, filename, options).returns(content) end it { subject.must_be_instance_of(Vedeu::Views::Views) } end end end # View end # DSL end # Vedeu
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
vedeu-0.8.0 | test/lib/vedeu/dsl/view_test.rb |