Skip to content

Commit ae560ec

Browse files
authored
Update README.md
1 parent 771db4a commit ae560ec

1 file changed

Lines changed: 5 additions & 5 deletions

File tree

README.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ You may get the actual version from [installation instructions](https://pub.dart
2525
### Write features
2626

2727
Create `*.feature` file inside `test` folder. Let's say you're testing the default Flutter counter app, the content might be:
28-
```
28+
```ruby
2929
Feature: Counter
3030
Scenario: Initial counter value is 0
3131
Given the app is running
@@ -50,7 +50,7 @@ flutter test
5050
## Feature file syntax
5151

5252
Feature file sample:
53-
```
53+
```ruby
5454
// comment here
5555

5656
Feature: Counter
@@ -137,7 +137,7 @@ That will tell the plugin to reuse steps from the plugin itself and do not put t
137137
### How to pass a parameter?
138138
139139
You may use curly brackets to pass the parameter into a `step`. The syntax is following:
140-
```
140+
```ruby
141141
When I see {42} number
142142
And I see {Icons.add} icon
143143
```
@@ -148,7 +148,7 @@ You may call methods in step parameters, but most probably it's not what you wan
148148
### How to add additional imports to test files?
149149

150150
Most of the time you shouldn't do that, as the BDD tests simulate user's behavior and it's just not possible for users to know the implementation details. Nevertheless, sometimes it might be in hand, i.e. when you have custom domain models or components. For example, if you need to check Cupertino icons in the test, you may have:
151-
```
151+
```ruby
152152
import 'package:flutter/cupertino.dart';
153153
154154
Feature: ...
@@ -158,7 +158,7 @@ Feature: ...
158158
### How to adjust linter for auto-generated tests?
159159

160160
Use the same trick as above, just write linter rules you wish to ignore at the beginning of the feature file:
161-
```
161+
```ruby
162162
// ignore_for_file: avoid_as, prefer_is_not_empty
163163
164164
Feature: ...

0 commit comments

Comments
 (0)