Skip to content

Commit

Permalink
Merge pull request #57 from illuzor/versions6
Browse files Browse the repository at this point in the history
Versions update and tests fix
  • Loading branch information
pawegio committed Aug 22, 2018
2 parents f5f6437 + 9e6b588 commit 5c58743
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 22 deletions.
8 changes: 4 additions & 4 deletions .travis.yml
Expand Up @@ -2,13 +2,13 @@ language: android
android:
components:
- tools
- build-tools-27.0.3
- build-tools-28.0.2
- android-22
- android-27
- android-28
- sys-img-armeabi-v7a-android-22
before_install:
- yes | sdkmanager "platforms;android-27"
- yes | sdkmanager "build-tools;27.0.3"
- yes | sdkmanager "platforms;android-28"
- yes | sdkmanager "build-tools;28.0.2"
jdk:
- oraclejdk8
before_script:
Expand Down
4 changes: 2 additions & 2 deletions build.gradle
Expand Up @@ -17,14 +17,14 @@
// Top-level build file where you can add configuration options common to all sub-projects/modules.

buildscript {
ext.kotlin_version = '1.2.30'
ext.kotlin_version = '1.2.61'
repositories {
google()
jcenter()
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.0.1'
classpath 'com.android.tools.build:gradle:3.2.0-beta05'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
classpath 'com.github.dcendents:android-maven-gradle-plugin:1.5'
classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.7.3'
Expand Down
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Expand Up @@ -19,4 +19,4 @@ distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-4.6-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-4.9-all.zip
12 changes: 6 additions & 6 deletions kandroid/build.gradle
Expand Up @@ -30,12 +30,12 @@ def siteUrl = 'https://github.com/pawegio/KAndroid'
def gitUrl = 'https://github.com/pawegio/KAndroid.git'

android {
compileSdkVersion 27
buildToolsVersion "27.0.3"
compileSdkVersion 28
buildToolsVersion "28.0.2"

defaultConfig {
minSdkVersion 16
targetSdkVersion 27
targetSdkVersion 28
versionCode 1
versionName version
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
Expand Down Expand Up @@ -90,10 +90,10 @@ dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])

testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.1'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.1'
androidTestImplementation 'com.android.support.test:runner:1.0.2'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'

implementation 'com.android.support:appcompat-v7:27.0.2'
implementation 'com.android.support:appcompat-v7:28.0.0-rc01'
implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
}

Expand Down
Expand Up @@ -16,7 +16,7 @@

package com.pawegio.kandroid

import android.support.test.annotation.UiThreadTest
import android.support.test.InstrumentationRegistry
import android.support.test.runner.AndroidJUnit4
import android.view.View
import android.view.ViewGroup
Expand All @@ -30,18 +30,18 @@ import com.pawegio.kandroid.test.R
@RunWith(AndroidJUnit4::class)
class ContextTest {

private val instrumentation = InstrumentationRegistry.getInstrumentation()

@Test
@UiThreadTest
fun shortToastTest() {
fun shortToastTest() = instrumentation.runOnMainSync {
val toast = context.toast("Hello short toast")
assertEquals(View.VISIBLE, toast.view.visibility)
assertEquals(Toast.LENGTH_SHORT, toast.duration)
assertEquals("Hello short toast", getToastText(toast))
}

@Test
@UiThreadTest
fun shortToastWithResTest() {
fun shortToastWithResTest() = instrumentation.runOnMainSync {
val text = context.getString(R.string.toast_test_text)
val toast = context.toast(text)
assertEquals(View.VISIBLE, toast.view.visibility)
Expand All @@ -50,17 +50,15 @@ class ContextTest {
}

@Test
@UiThreadTest
fun longToastTest() {
fun longToastTest() = instrumentation.runOnMainSync {
val toast = context.longToast("Hello long toast")
assertEquals(View.VISIBLE, toast.view.visibility)
assertEquals(Toast.LENGTH_LONG, toast.duration)
assertEquals("Hello long toast", getToastText(toast))
}

@Test
@UiThreadTest
fun longToastTestWithResTest() {
fun longToastTestWithResTest() = instrumentation.runOnMainSync {
val text = context.getString(R.string.toast_long_test_text)
val toast = context.longToast(text)
assertEquals(View.VISIBLE, toast.view.visibility)
Expand Down

0 comments on commit 5c58743

Please sign in to comment.