Skip to content

Instantly share code, notes, and snippets.

Avatar

Christian Williams xian

View GitHub Profile
@xian
xian / 00_README.md
Last active Dec 14, 2015 — forked from JakeWharton/ActionBarSherlockRobolectric.java
Here's the magic to get ActionBarSherlock working with Robolectric 2.0-alpha-2!
View 00_README.md

You need to add the files below, and do this once in your base test runner:

ActionBarSherlock.registerImplementation(ActionBarSherlockRobolectric.class);
ActionBarSherlock.unregisterImplementation(ActionBarSherlockNative.class);
ActionBarSherlock.unregisterImplementation(ActionBarSherlockCompat.class);
@xian
xian / gist:730793
Created Dec 6, 2010
Android: include build number and date
View gist:730793
<property environment="env"/>
<condition property="build.number" value="${env.BUILD_NUMBER}" else="unknown">
<isset property="env.BUILD_NUMBER"/>
</condition>
<exec command="date" outputproperty="build.date"/>
<target name="update-buildinfo">
<echo>updating build number and date to ${build.number} and ${build.date}</echo>
<echo file="res/values/buildinfo.xml"
View Capture Android log messages in tests with Robolectric
package com.pivotallabs;
import android.util.Log;
import com.xtremelabs.robolectric.Robolectric;
import com.xtremelabs.robolectric.RobolectricTestRunner;
import com.xtremelabs.robolectric.util.Implements;
import org.junit.Test;
import org.junit.runner.RunWith;
@RunWith(RobolectricTestRunner.class)