Nice. I like this code to gather the fixture files, but it''s just a
different taste.
fixture_list = Dir.entries(File.join(RAILS_ROOT,
''test/fixtures'')).inject([]) do |array, file|
array << $`.to_sym if file =~ /\.yml$/
array
end
-Jonathan.
On 8/5/06, Alex Wayne <rubyonrails@beautifulpixel.com>
wrote:> Just released a very simple plugin for including all fixtures in your
> tests. Once you have a large number of table, manually managing the
> fixtures for every single test stub can be quite tedious.
>
> Use as follows
>
> class BlogArticleTest < Test::Unit::TestCase
> all_fixtures
> def test_foo
> ...
> end
> end
>
> Couldn''t be easier. More info here:
> http://beautifulpixel.com/articles/2006/08/04/all-fixtures-plugin
>
> It works by simply scanning the fixtures directory for *.yml files, and
> converts it to an array of symbols that gets passed to the fixtures
> method. Performance seems identical with and without.
>
> Hope it makes someone life easier.
>
> --
> Posted via http://www.ruby-forum.com/.
> _______________________________________________
> Rails mailing list
> Rails@lists.rubyonrails.org
> http://lists.rubyonrails.org/mailman/listinfo/rails
>