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

Bug: inject or instantiate Feather class does not work #12

Open
sealor opened this issue Sep 18, 2017 · 1 comment
Open

Bug: inject or instantiate Feather class does not work #12

sealor opened this issue Sep 18, 2017 · 1 comment

Comments

@sealor
Copy link

sealor commented Sep 18, 2017

Hello feather team,

your DI framework fits very well for my use case. But unfortunately there is a bug which makes it unusable for me.

Could you please fix this issue?! Thank you.

import org.codejargon.feather.Feather;
import org.codejargon.feather.Provides;
import org.junit.Test;

import static org.codejargon.feather.Feather.with;
import static org.junit.Assert.assertEquals;

public class FeatherTest {

    @Test
    public void injectFeatherShouldWork() {
        Feather feather = with(new Object() {
            @Provides
            public String createString(Feather feather) {
                return feather.toString();
            }
        });

        assertEquals(feather.toString(), feather.instance(String.class));
    }

    @Test
    public void instantiateFeatherShouldWork() {
        Feather feather = with();
        assertEquals(feather, feather.instance(Feather.class));
    }

}

Best regards,
Stefan

@bowbahdoe
Copy link

@ahjmorton @sealor

If any of y'all still care, I fixed this issue in my fork here

<dependency>
    <groupId>dev.mccue</groupId>
    <artifactId>feather</artifactId>
    <version>0.0.2</version>
</dependency>

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