# SpannedSubject.RubyText

# SpannedSubject.RubyText

Artifact:[androidx.media3:media3-test-utils](https://developer.android.com/jetpack/androidx/releases/media3)  
[View Source](https://cs.android.com/search?q=file:androidx/media3/test/utils/truth/SpannedSubject.java+class:androidx.media3.test.utils.truth.SpannedSubject.RubyText)

*** ** * ** ***

Kotlin\|[Java](https://developer.android.com/reference/androidx/media3/test/utils/truth/SpannedSubject.RubyText "View this page in Java")

<br />

```
interface SpannedSubject.RubyText
```

<br />

*** ** * ** ***

Allows assertions about a span's ruby text and its position.

## Summary

|                                                             ### Public functions                                                              |
|-----------------------------------------------------------------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [SpannedSubject.AndSpanFlags](https://developer.android.com/reference/kotlin/androidx/media3/test/utils/truth/SpannedSubject.AndSpanFlags)`!` | [withTextAndPosition](https://developer.android.com/reference/kotlin/androidx/media3/test/utils/truth/SpannedSubject.RubyText#withTextAndPosition(java.lang.String,int))`(text: `[String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)`!, @`[TextAnnotation.Position](https://developer.android.com/reference/kotlin/androidx/media3/common/text/TextAnnotation.Position)` position: `[Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)`)` Checks that at least one of the matched spans has the expected`text`. |

## Public functions

### withTextAndPosition

```
fun withTextAndPosition(text: String!, @TextAnnotation.Position position: Int): SpannedSubject.AndSpanFlags!
```

Checks that at least one of the matched spans has the expected`text`.  

|                                                                                                        Parameters                                                                                                        |
|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|------------------------------------|
| `text: `[String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)`!`                                                                                                                             | The expected text.                 |
| `@`[TextAnnotation.Position](https://developer.android.com/reference/kotlin/androidx/media3/common/text/TextAnnotation.Position)` position: `[Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html) | The expected position of the text. |

|                                                                    Returns                                                                    |
|-----------------------------------------------------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [SpannedSubject.AndSpanFlags](https://developer.android.com/reference/kotlin/androidx/media3/test/utils/truth/SpannedSubject.AndSpanFlags)`!` | A[WithSpanFlags](https://developer.android.com/reference/kotlin/androidx/media3/test/utils/truth/SpannedSubject.WithSpanFlags)object for optional additional assertions on the flags. |