@@ -12,8 +12,8 @@ fun View.shouldNotBeVisible() = this shouldNot beVisible()
1212fun beVisible () = object : Matcher <View > {
1313 override fun test (value : View ) = MatcherResult (
1414 value.visibility == View .VISIBLE ,
15- " View should be VISIBLE but was ${value.visibilityAsString()} " ,
16- " View should not be VISIBLE, but was"
15+ { " View should be VISIBLE but was ${value.visibilityAsString()} " } ,
16+ { " View should not be VISIBLE, but was" }
1717 )
1818}
1919
@@ -23,8 +23,8 @@ fun View.shouldNotBeInvisible() = this shouldNot beInvisible()
2323fun beInvisible () = object : Matcher <View > {
2424 override fun test (value : View ) = MatcherResult (
2525 value.visibility == View .INVISIBLE ,
26- " View should be INVISIBLE, but was ${value.visibilityAsString()} " ,
27- " View should not be INVISIBLE, but was"
26+ { " View should be INVISIBLE, but was ${value.visibilityAsString()} " } ,
27+ { " View should not be INVISIBLE, but was" }
2828 )
2929}
3030
@@ -34,8 +34,8 @@ fun View.shouldNotBeGone() = this shouldNot beGone()
3434fun beGone () = object : Matcher <View > {
3535 override fun test (value : View ) = MatcherResult (
3636 value.visibility == View .GONE ,
37- " View should be GONE, but was ${value.visibilityAsString()} " ,
38- " View should not be GONE, but was"
37+ { " View should be GONE, but was ${value.visibilityAsString()} " } ,
38+ { " View should not be GONE, but was" }
3939 )
4040
4141}
@@ -54,8 +54,8 @@ fun View.shouldNotHaveContentDescription() = this shouldNot haveContentDescripti
5454fun haveContentDescription () = object : Matcher <View > {
5555 override fun test (value : View ) = MatcherResult (
5656 value.contentDescription != null && value.contentDescription.isNotBlank(),
57- " View should have ContentDescription, but had none" ,
58- " View should not have ContentDescription, but had ${value.contentDescription} "
57+ { " View should have ContentDescription, but had none" } ,
58+ { " View should not have ContentDescription, but had ${value.contentDescription} " }
5959 )
6060}
6161
@@ -65,8 +65,8 @@ infix fun View.shouldNotHaveContentDescription(contentDescription: String) = thi
6565fun haveContentDescription (contentDescription : String ) = object : Matcher <View > {
6666 override fun test (value : View ) = MatcherResult (
6767 contentDescription.contentEquals(value.contentDescription),
68- " View should have ContentDescription $contentDescription , but was ${value.contentDescription} " ,
69- " View should not have ContentDescription $contentDescription , but had"
68+ { " View should have ContentDescription $contentDescription , but was ${value.contentDescription} " } ,
69+ { " View should not have ContentDescription $contentDescription , but had" }
7070 )
7171}
7272
@@ -78,8 +78,8 @@ fun View.shouldNotHaveTag(key: Int, value: Any) = this shouldNot haveTag(key, va
7878fun haveTag (key : Int , tagValue : Any ) = object : Matcher <View > {
7979 override fun test (value : View ) = MatcherResult (
8080 value.getTag(key) == tagValue,
81- " View should have tag with Key $key and value $tagValue , but value was $tagValue " ,
82- " View should not have tag with Key $key and value $tagValue , but had"
81+ { " View should have tag with Key $key and value $tagValue , but value was $tagValue " } ,
82+ { " View should not have tag with Key $key and value $tagValue , but had" }
8383 )
8484}
8585
@@ -89,8 +89,8 @@ infix fun View.shouldNotHaveTag(value: Any) = this shouldNot haveTag(value)
8989fun haveTag (tagValue : Any ) = object : Matcher <View > {
9090 override fun test (value : View ) = MatcherResult (
9191 value.tag == tagValue,
92- " View should have tag with value $tagValue , but was ${value.tag} " ,
93- " View should not have tag with value $tagValue , but had"
92+ { " View should have tag with value $tagValue , but was ${value.tag} " } ,
93+ { " View should not have tag with value $tagValue , but had" }
9494 )
9595}
9696
@@ -100,8 +100,8 @@ fun View.shouldNotBeEnabled() = this shouldNot beEnabled()
100100fun beEnabled () = object : Matcher <View > {
101101 override fun test (value : View ) = MatcherResult (
102102 value.isEnabled,
103- " View should be enabled, but isn't" ,
104- " View should not be enabled, but is"
103+ { " View should be enabled, but isn't" } ,
104+ { " View should not be enabled, but is" }
105105 )
106106}
107107
@@ -111,8 +111,8 @@ fun View.shouldNotBeFocused() = this shouldNot beFocused()
111111fun beFocused () = object : Matcher <View > {
112112 override fun test (value : View ) = MatcherResult (
113113 value.isFocused,
114- " View should be focused, but isn't" ,
115- " View should not be focused, but is"
114+ { " View should be focused, but isn't" } ,
115+ { " View should not be focused, but is" }
116116 )
117117}
118118
@@ -122,8 +122,8 @@ fun View.shouldNotBeFocusable() = this shouldNot beFocusable()
122122fun beFocusable () = object : Matcher <View > {
123123 override fun test (value : View ) = MatcherResult (
124124 value.isFocusable,
125- " View should be focusable, but isn't" ,
126- " View should not be focusable, but is"
125+ { " View should be focusable, but isn't" } ,
126+ { " View should not be focusable, but is" }
127127 )
128128}
129129
@@ -133,8 +133,8 @@ fun View.shouldNotBeFocusableInTouchMode() = this shouldNot beFocusableInTouchMo
133133fun beFocusableInTouchMode () = object : Matcher <View > {
134134 override fun test (value : View ) = MatcherResult (
135135 value.isFocusableInTouchMode,
136- " View should be focusable in touch mode, but isn't" ,
137- " View should not be focusable in touch mode, but is"
136+ { " View should be focusable in touch mode, but isn't" } ,
137+ { " View should not be focusable in touch mode, but is" }
138138 )
139139}
140140
@@ -144,8 +144,8 @@ fun View.shouldNotBeClickable() = this shouldNot beClickable()
144144fun beClickable () = object : Matcher <View > {
145145 override fun test (value : View ) = MatcherResult (
146146 value.isClickable,
147- " View should be clickable, but isn't" ,
148- " View should not be clickable, but is"
147+ { " View should be clickable, but isn't" } ,
148+ { " View should not be clickable, but is" }
149149 )
150150}
151151
@@ -155,7 +155,7 @@ fun View.shouldNotBeLongClickable() = this shouldNot beLongClickable()
155155fun beLongClickable () = object : Matcher <View > {
156156 override fun test (value : View ) = MatcherResult (
157157 value.isLongClickable,
158- " View should be long clickable, but isn't" ,
159- " View should not be long clickable, but is"
158+ { " View should be long clickable, but isn't" } ,
159+ { " View should not be long clickable, but is" }
160160 )
161161}
0 commit comments