Skip to content

Instantly share code, notes, and snippets.

View Maragues's full-sized avatar

Miguel Aragues Maragues

  • Kolibree
  • Zaragoza, Spain
View GitHub Profile

Keybase proof

I hereby claim:

  • I am maragues on github.
  • I am maragues (https://keybase.io/maragues) on keybase.
  • I have a public key ASC3Upz7cBDyiR3YIICP8iFyqFnJ5oc_h1mzpfRrFcHf8Ao

To claim this, I am signing this object:

class PropertyTestSum : StringSpec({
"Sum is commutative " {
assertAll { a: Int, b: Int ->
sum(a, b) shouldBe sum(b, a)
}
}
"Sum is associative " {
assertAll { a: Int, b: Int, c: Int ->
sum(a, b, c) shouldBe sum(a, c, b)
/**
* This rule registers SchedulerHooks for RxJava and RxAndroid to ensure that subscriptions
* always subscribeOn and observeOn Schedulers.immediate().
* Warning, this rule will resetProcedureStatus RxAndroidPlugins and RxJavaPlugins after each test so
* if the application code uses RxJava plugins this may affect the behaviour of the testing method.
* <p>
*
* See https://medium.com/@fabioCollini/testing-asynchronous-rxjava-code-using-mockito-8ad831a16877#.ahj5h7jmg
* See https://github.com/fabioCollini/TestingRxJavaUsingMockito/blob/master/app/src/test/java/it/codingjam/testingrxjava/TestSchedulerRule.java
*/
@Maragues
Maragues / Picasso idlingresource.md
Last active August 10, 2016 09:55
Implementation and usage of an IdlingResource that waits for Picasso actions to finish.

Note that the file lives in the package as Picasso. Otherwise we don't have access to targetToAction

package com.squareup.picasso;

public class PicassoIdlingResource implements IdlingResource, ActivityLifecycleCallback {
  protected ResourceCallback callback;

  WeakReference<Picasso> picassoWeakReference;
@Maragues
Maragues / DataDroidOkHttp
Created October 1, 2013 10:04
DataDroid + OkHttp Integration through reflection
public static ConnectionResult execute(...){
[...]
URL url = null;
String outputText = null;
switch (method) {
case GET:
case DELETE:
String fullUrlValue = urlValue;
if (paramBuilder.length() > 0) {
// additional required configuration to hook into the build script
android {
signingConfigs {
release
}
buildTypes {
release {
signingConfig signingConfigs.release
}