Skip to content

Commit

Permalink
Fixed tests and package versions.
Browse files Browse the repository at this point in the history
  • Loading branch information
Joran-Dob committed Mar 7, 2021
1 parent a12f49a commit 65aef40
Show file tree
Hide file tree
Showing 6 changed files with 36 additions and 19 deletions.
2 changes: 1 addition & 1 deletion example/.flutter-plugins-dependencies
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"info":"This is a generated file; do not edit or check into version control.","plugins":{"ios":[{"name":"video_player","path":"/Users/joran.dob/.pub-cache/hosted/pub.dartlang.org/video_player-1.0.1/","dependencies":[]},{"name":"wakelock","path":"/Users/joran.dob/.pub-cache/hosted/pub.dartlang.org/wakelock-0.2.1+1/","dependencies":[]}],"android":[{"name":"video_player","path":"/Users/joran.dob/.pub-cache/hosted/pub.dartlang.org/video_player-1.0.1/","dependencies":[]},{"name":"wakelock","path":"/Users/joran.dob/.pub-cache/hosted/pub.dartlang.org/wakelock-0.2.1+1/","dependencies":[]}],"macos":[],"linux":[],"windows":[],"web":[{"name":"import_js_library","path":"/Users/joran.dob/.pub-cache/hosted/pub.dartlang.org/import_js_library-1.0.2/","dependencies":[]},{"name":"video_player_web","path":"/Users/joran.dob/.pub-cache/hosted/pub.dartlang.org/video_player_web-0.1.4+1/","dependencies":[]},{"name":"wakelock_web","path":"/Users/joran.dob/.pub-cache/hosted/pub.dartlang.org/wakelock_web-0.1.0+3/","dependencies":["import_js_library"]}]},"dependencyGraph":[{"name":"import_js_library","dependencies":[]},{"name":"video_player","dependencies":["video_player_web"]},{"name":"video_player_web","dependencies":[]},{"name":"wakelock","dependencies":["wakelock_web"]},{"name":"wakelock_web","dependencies":["import_js_library"]}],"date_created":"2021-03-07 14:45:54.058477","version":"2.0.0"}
{"info":"This is a generated file; do not edit or check into version control.","plugins":{"ios":[{"name":"video_player","path":"/Users/joran.dob/.pub-cache/hosted/pub.dartlang.org/video_player-1.0.1/","dependencies":[]},{"name":"wakelock","path":"/Users/joran.dob/.pub-cache/hosted/pub.dartlang.org/wakelock-0.2.1+1/","dependencies":[]}],"android":[{"name":"video_player","path":"/Users/joran.dob/.pub-cache/hosted/pub.dartlang.org/video_player-1.0.1/","dependencies":[]},{"name":"wakelock","path":"/Users/joran.dob/.pub-cache/hosted/pub.dartlang.org/wakelock-0.2.1+1/","dependencies":[]}],"macos":[],"linux":[],"windows":[],"web":[{"name":"import_js_library","path":"/Users/joran.dob/.pub-cache/hosted/pub.dartlang.org/import_js_library-1.0.2/","dependencies":[]},{"name":"video_player_web","path":"/Users/joran.dob/.pub-cache/hosted/pub.dartlang.org/video_player_web-0.1.4+1/","dependencies":[]},{"name":"wakelock_web","path":"/Users/joran.dob/.pub-cache/hosted/pub.dartlang.org/wakelock_web-0.1.0+3/","dependencies":["import_js_library"]}]},"dependencyGraph":[{"name":"import_js_library","dependencies":[]},{"name":"video_player","dependencies":["video_player_web"]},{"name":"video_player_web","dependencies":[]},{"name":"wakelock","dependencies":["wakelock_web"]},{"name":"wakelock_web","dependencies":["import_js_library"]}],"date_created":"2021-03-07 15:03:14.490650","version":"2.0.0"}
4 changes: 2 additions & 2 deletions lib/subtitle_controller.dart
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ class SubtitleController {
),
);
} else {
throw 'Seems that the controller is not correctly attached.';
throw Exception('Seems that the controller is not correctly attached.');
}
}

Expand All @@ -54,7 +54,7 @@ class SubtitleController {
),
);
} else {
throw 'Seems that the controller is not correctly attached.';
throw Exception('Seems that the controller is not correctly attached.');
}
}
}
Expand Down
4 changes: 2 additions & 2 deletions pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -276,12 +276,12 @@ packages:
source: hosted
version: "5.0.0"
mocktail:
dependency: transitive
dependency: "direct overridden"
description:
name: mocktail
url: "https://pub.dartlang.org"
source: hosted
version: "0.0.2-dev.2"
version: "0.0.1-dev.12"
nested:
dependency: transitive
description:
Expand Down
3 changes: 3 additions & 0 deletions pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,7 @@ dev_dependencies:
mockito: ^5.0.0
video_player: ^2.0.0

dependency_overrides:
mocktail: 0.0.1-dev.12

flutter:
8 changes: 4 additions & 4 deletions test/subtitle_bloc_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ void main() {
group(
'Subtitle BLoC',
() {
blocTest(
blocTest<SubtitleBloc, SubtitleState>(
'subtitle init',
build: () => SubtitleBloc(
subtitleController: _subtitleController,
Expand All @@ -27,7 +27,7 @@ void main() {
),
videoPlayerController: MockVideoPlayerController(),
),
act: (dynamic bloc) => bloc.add(
act: (SubtitleBloc bloc) => bloc.add(
InitSubtitles(
subtitleController: _subtitleController,
),
Expand All @@ -37,7 +37,7 @@ void main() {
SubtitleInitialized(),
],
);
blocTest(
blocTest<SubtitleBloc, SubtitleState>(
'subtitle update',
build: () => SubtitleBloc(
subtitleController: _subtitleController,
Expand Down Expand Up @@ -70,7 +70,7 @@ void main() {
],
);

blocTest(
blocTest<SubtitleBloc, SubtitleState>(
'subtitle load',
build: () => SubtitleBloc(
subtitleController: _subtitleController,
Expand Down
34 changes: 24 additions & 10 deletions test/subtitle_controller_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -55,16 +55,30 @@ void main() {
);
});

test('update subtitle content without attach', () async {
_subtitleController.detach();
_subtitleController.updateSubtitleContent(
content: '',
);
});
test('update subtitle url without attach', () async {
_subtitleController.detach();
_subtitleController.updateSubtitleUrl(
url: 'https://pastebin.com/raw/ZWWAL7fK',
test(
'update subtitle content without attach',
() {
expect(
() {
_subtitleController.detach();
_subtitleController.updateSubtitleContent(
content: '',
);
},
throwsException,
);
},
);

test('update subtitle url without attach', () {
expect(
() {
_subtitleController.detach();
_subtitleController.updateSubtitleUrl(
url: 'https://pastebin.com/raw/ZWWAL7fK',
);
},
throwsException,
);
});
},
Expand Down

0 comments on commit 65aef40

Please sign in to comment.