Skip to main content

Posts

Showing posts with the label unit-testing

Testing view helpers

I'm currently working on a Rails plugin used for generating iPhone specific HTML meta-tags. I'm trying to use ActionView::TestCase for unit tests but keep getting the same error. See file contents and error below. Any ideas or help would be much appreciated. test_helper.rb require 'rubygems' require 'test/unit' require 'active_support' require 'action_view' require File.join(File.dirname(__FILE__), '..', 'lib', 'iphone_helper') iphone_test_helper.rb require 'test_helper' class IphoneHelperTest < ActionView::TestCase test 'br' do tag = tag('br') assert_tag_in tag, '<br />' end end error RuntimeError: In order to use #url_for, you must include routing helpers explicitly. For instance, `include Rails.application.routes.url_helpers

differences between 2 JUnit Assert classes

I've noticed that the JUnit framework contains 2 Assert classes (in different packages, obviously) and the methods on each appear to be very similar. Can anybody explain why this is? The classes I'm referring to are: junit.framework.Assert and org.junit.Assert . Cheers, Don

Android : testing a service

we are actually developping an audio service (in the android sense of the term) and we have quite of lot of tests to cover many aspects of our APIs. But we are actually wondering for good things to do to test a service efficiently. So this question is quite open: how would you test an android service ? We are currently using JUnit + EasyMock on test both on real devices and Continous Integration server (via an emulator). Any suggestion is welcome, thx in advance. PS : we have been searching SOF for similar threads but we just found a few cues in those depleted threads : Instrumentation Test case how to bind service from activity Android Service Testing Why is an Android Service not singleton when testing?