Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Unit Tests #189

Closed
chrisjenx opened this issue Mar 1, 2013 · 10 comments
Closed

Add Unit Tests #189

chrisjenx opened this issue Mar 1, 2013 · 10 comments
Labels

Comments

@chrisjenx
Copy link
Contributor

It would save you alot of time when regression testing if you added some unit test.

Especially in the case of the image downloaders.

@nostra13
Copy link
Owner

nostra13 commented Mar 1, 2013

I would love to, but I have very few time for developing the library and no time to write unit tests.

@chrisjenx
Copy link
Contributor Author

Ok fair enough, Just keep watching pull requests and I will enable the lib to work with Travis CI. And pad out some tests.

@nostra13
Copy link
Owner

nostra13 commented Mar 1, 2013

Ok, thanks :)

@nostra13
Copy link
Owner

Can't run tests on Windows using Maven:
java.lang.RuntimeException: Stub!
Although I placed robolectric and its dependencies (including JUnit) before the Android jars in the pom.xml.

@chrisjenx
Copy link
Contributor Author

robolectric should be before junit.

This is my testing dependency.

<!--  Robo Electric -->
        <dependency>
            <groupId>com.squareup</groupId>
            <artifactId>fest-android</artifactId>
            <version>1.0.3</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.robolectric</groupId>
            <artifactId>robolectric</artifactId>
            <version>2.0-alpha-3-SNAPSHOT</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <version>4.8.2</version>
            <scope>test</scope>
        </dependency>

@nostra13
Copy link
Owner

nostra13 commented Apr 1, 2013

Still have the problem... Searching a solution...

@chrisjenx
Copy link
Contributor Author

You have @RunWith(RobolectricRunner.class) at the top of you test case.

Also remembering that any class/lib you don't have implemented you'll need
to mock.
On 1 Apr 2013 08:18, "Sergey Tarasevich" [email protected] wrote:

Still have the problem... Searching a solution...


Reply to this email directly or view it on GitHubhttps://github.com//issues/189#issuecomment-15706401
.

nostra13 added a commit that referenced this issue Apr 6, 2013
@nostra13
Copy link
Owner

nostra13 commented Apr 6, 2013

I use robolectric-2.0-alpha-1 to avoid "Stub!" problem.

@chrisjenx
Copy link
Contributor Author

Stub just means it can't find a class it's trying to run.

if you look at my fork and the commits made you will see what is necessary
to make it work :)
On 6 Apr 2013 13:31, "Sergey Tarasevich" [email protected] wrote:

I use robolectric-2.0-alpha-1 to avoid "Stub!" problem.


Reply to this email directly or view it on GitHubhttps://github.com//issues/189#issuecomment-15995412
.

@nostra13
Copy link
Owner

Your fork has the same "Stub!" problem for me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants