test/buildmaster/templatelets/tc_text.rb in BuildMaster-0.8.1 vs test/buildmaster/templatelets/tc_text.rb in BuildMaster-0.9.0
- old
+ new
@@ -8,29 +8,34 @@
require 'rexml/xpath'
require 'buildmaster/site_spec'
require 'buildmaster/source_content'
module BuildMaster
-class TextTest < CommonTemplateletTest
- def test_should_generate_text_based_on_property
+context 'TextTest' do
+ include HelperMethods
+ setup do
+ setup_spec
+ end
+
+ specify 'should_generate_text_based_on_property' do
target = create_element('target')
template = create_element('text')
template.attributes['property'] = 'property'
text = Text.new({'property' => 'text'})
text.process(target, template, nil)
- assert_equal('text', target.text)
+ target.text.should_equal 'text'
end
- def test_should_throw_exception_if_property_not_set
+ specify 'should_throw_exception_if_property_not_set' do
target = create_element('target')
template = create_element('text')
template.attributes['property'] = 'one'
text = Text.new(Hash.new)
begin
text.process(target, template, nil)
- fail('TemplateException should have been thrown')
- rescue TemplateException => exception
- assert_equal(true, exception.message.include?('one'))
+ fail('TemplateError should have been thrown')
+ rescue TemplateError => exception
+ exception.message.include?('one').should_equal true
end
end
end
end
\ No newline at end of file