minitest, test::unit, and rails

There is a Test::Unit “compatibility” module that comes with Minitest, so that you can (presumably) use your existing Test::Unit tests as-is. This is probably the Test::Unit module you are seeing. As of rails 3.2.3, generator-created tests include rails/test_help which includes test/unit. The test “something” do syntax is a rails extension. It’s defined in ActiveSupport::Testing::Declarative, which … Read more

Best practices for new Rails deployments on Linux?

I switched from Mongrel Cluster to Passenger two weeks ago (Debian Linux Server). I didn’t look back for a second. Passenger is probably the easiest way to get your new server up and running. Performance and reliability are reasonable too. Personally, I like to spend my time working on exciting new Rails projects rather than … Read more

How should I provide YARD/RDoc documentation for Ruby keyword arguments?

Should I just continue to use the @param keyword? Yes. YARD recognizes keyword arguments. Use @param to document a single method parameter (either regular or keyword) with a given name, type and optional description: # @param query [String] The search string # @param exact_match [Boolean] whether to do an exact match # @param results_per_page [Integer] … Read more

Ruby: Too many open files @ rb_sysopen

EMFILE is too many files opened in your process. ENFILE is too many files opened in the entire system. So Errno::EMFILE is due to the ruby process opening too many files. This limit is probably set to the default 1024 can be seen with: $ulimit -n 1024 Instead of: $ulimit unlimited You can raise the … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)