Skip to content

Rule examples doesn't work in Kotlin #219

Description

@FireZenk

As specified, the way to define rules in our tests is:

@Rule
public BaristaRule<MyActivity> baristaRule = BaristaRule.create(MyActivity.class);

But translated to Kotlin, we'll get:

@Rule
var baristaRule = BaristaRule.create(MyActivity::class.java)

This will throw an exception like: The @Rule 'baristaRule' must be public

The way to correctly define the Rule in Kotlin is:

@get:Rule
var baristaRule = BaristaRule.create(MyActivity::class.java)

So, maybe will be good to add this divergence somewhere

Activity

  1. rocboronat commented on Jun 16, 2018

    @rocboronat
    Member

    #221 is a proposal to fix this issue 🎉 🍌

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions