Mercurial > hg > soundsoftware-site
view .svn/pristine/75/7537e9eba2daabb99d2e6fee47a3f35857d9e159.svn-base @ 985:acaa61dde68b bug_522
Allow file attachment to wrap to avoid extra-wide text field
author | Chris Cannam <chris.cannam@soundsoftware.ac.uk> |
---|---|
date | Fri, 26 Oct 2012 17:18:52 +0100 |
parents | cbb26bc654de |
children |
line wrap: on
line source
require File.dirname(__FILE__) + '/../test_helper' class ArbitraryCodeMixingTest < Test::Unit::TestCase def setup Engines.code_mixing_file_types = %w(controller helper) end def test_should_allow_setting_of_different_code_mixing_file_types assert_nothing_raised { Engines.mix_code_from :things } end def test_should_add_new_types_to_existing_code_mixing_file_types Engines.mix_code_from :things assert_equal ["controller", "helper", "thing"], Engines.code_mixing_file_types Engines.mix_code_from :other assert_equal ["controller", "helper", "thing", "other"], Engines.code_mixing_file_types end def test_should_allow_setting_of_multiple_types_at_once Engines.mix_code_from :things, :other assert_equal ["controller", "helper", "thing", "other"], Engines.code_mixing_file_types end def test_should_singularize_elements_to_be_mixed # this is the only test using mocha, so let's try to work around it # also, this seems to be already tested with the :things in the tests above # arg = stub(:to_s => stub(:singularize => "element")) Engines.mix_code_from :elements assert Engines.code_mixing_file_types.include?("element") end # TODO doesn't seem to work as expected? # def test_should_successfully_mix_custom_types # Engines.mix_code_from :things # assert_equal 'Thing (from app)', Thing.from_app # assert_equal 'Thing (from test_code_mixing)', Thing.from_plugin # end end