Skip to content

Commit

Permalink
Preparing 3.0-beta1
Browse files Browse the repository at this point in the history
  • Loading branch information
Sergej Shafarenka committed Nov 11, 2018
1 parent a027deb commit c6f3513
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
1 change: 1 addition & 0 deletions magnet-extensions/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ ext.deps.leakcanary = 'com.squareup.leakcanary:leakcanary-android:1.6.2'
ext.deps.rxandroid = 'io.reactivex.rxjava2:rxandroid:2.1.0'
ext.deps.kotlinjdk8 = "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_version"
ext.deps.kotlinjdk7 = "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
ext.deps.annotations = 'org.jetbrains:annotations:16.0.1'

// testing
ext.deps.junit = 'junit:junit:4.12'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,21 @@
* limitations under the License.
*/

package magnet
package magnet.kotlin

import magnet.Classifier
import magnet.Scope
import magnet.bind
import magnet.getOptional
import magnet.getSingle
import org.junit.Test
import org.junit.runner.RunWith
import org.mockito.Mock
import org.mockito.Mockito.any
import org.mockito.Mockito.anyString
import org.mockito.Mockito.verify
import org.mockito.junit.MockitoJUnitRunner
import org.mockito.Mockito.`when` as on

@Suppress("UNUSED_VARIABLE")
@RunWith(MockitoJUnitRunner.StrictStubs::class)
Expand Down Expand Up @@ -49,11 +57,14 @@ class ScopeExtTest {

@Test
fun testRegister() {
// given
on(scope.bind(any(Class::class.java), any(), anyString())).thenReturn(scope)

// when
scope.bind("component")

// then
verify(scope).bind("component", Classifier.NONE)
verify(scope).bind(String::class.java, "component", Classifier.NONE)
}

}

0 comments on commit c6f3513

Please sign in to comment.