package com.novoda.simplechromecustomtabs;

import com.novoda.notils.exception.DeveloperError;

import org.junit.Test;
import org.junit.runner.RunWith;
import org.robolectric.RobolectricTestRunner;
import org.robolectric.RuntimeEnvironment;

import static org.fest.assertions.api.Assertions.assertThat;

@RunWith(RobolectricTestRunner.class)
public class SimpleChromeCustomTabsTest {

    @Test(expected = DeveloperError.class)
    public void givenSimpleChromeCustomTabsIsNotInitialised_whenGettingInstance_thenDeveloperErrorIsThrown() {
        SimpleChromeCustomTabs.getInstance();
    }

    @Test
    public void givenSimpleChromeCustomTabsIsInitialised_whenGettingInstance_thenInstanceIsReturned() {
        SimpleChromeCustomTabs.initialize(RuntimeEnvironment.application);

        assertThat(SimpleChromeCustomTabs.getInstance()).isInstanceOf(SimpleChromeCustomTabs.class);
    }

}

@@ -295,16 +295,71 @@
 ertThat;
+%0Aimport static org.fest.assertions.api.Assertions.fail;
 %0A%0A@RunWi
@@ -446,41 +446,8 @@
 Test
-(expected = DeveloperError.class)
 %0A   
@@ -550,24 +550,42 @@
 sThrown() %7B%0A
+        try %7B%0A    
         Simp
@@ -618,16 +618,170 @@
 ance();%0A
+            fail(%22A Developer error exception was expected, but there was nothing%22);%0A        %7D catch (DeveloperError e) %7B%0A            // passes%0A        %7D%0A
     %7D%0A%0A 

Fix a test that was broken on some versions of java 8. Will change in the future