test/lib/vedeu/dsl/composition_test.rb in vedeu-0.4.36 vs test/lib/vedeu/dsl/composition_test.rb in vedeu-0.4.37

- old
+ new

@@ -44,17 +44,34 @@ Vedeu::Line.new(streams: [Vedeu::Stream.new(value: 'Oxygen')]), Vedeu::Line.new(streams: [Vedeu::Stream.new(value: 'Nitrogen')]) ] } - before do - Vedeu::Template.expects(:parse). - with(object, filename).returns(content) + subject { instance.template_for(_name, filename, object) } + + context 'when the name of the view is not given' do + let(:filename) { 'my_interface.erb' } + + it { proc { subject }.must_raise(MissingRequired) } end - subject { instance.template_for(_name, filename, object) } + context 'when the filename of the template is not given' do + let(:_name) { 'my_interface' } - it { subject.must_be_instance_of(Vedeu::Interfaces) } + it { proc { subject }.must_raise(MissingRequired) } + end + + context 'when the name and filename are given' do + let(:_name) { 'my_interface' } + let(:filename) { 'my_interface.erb' } + + before do + Vedeu::Template.expects(:parse). + with(object, filename).returns(content) + end + + it { subject.must_be_instance_of(Vedeu::Interfaces) } + end end end # Composition end # DSL