Skip to content

Commit

Permalink
Version update, and tests
Browse files Browse the repository at this point in the history
  • Loading branch information
leoafarias committed Oct 29, 2020
1 parent 4c4ff70 commit 8f334d7
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 4 deletions.
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
## 1.0.9-dev
## 1.0.9

- Ability to pass custom http Client as param.
- Changed latest version to display stable version only

## 1.0.8

Expand Down
2 changes: 1 addition & 1 deletion lib/src/version.dart

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: pub_api_client
description: An API Client for Pub to interact with public package information.
version: 1.0.9-dev
version: 1.0.9
homepage: https://github.com/leoafarias/pub_api_client

environment:
Expand All @@ -23,3 +23,4 @@ dev_dependencies:
remove_from_coverage: ^1.0.7
test: ^1.15.4
test_coverage: ^0.4.3
pubspec_yaml: ^2.0.1
12 changes: 11 additions & 1 deletion test/helpers_test.dart
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
import 'dart:async';
import 'dart:io';

import 'package:pub_api_client/pub_api_client.dart';
import 'package:pub_api_client/src/helpers/console_helper.dart';
import 'package:pub_api_client/src/helpers/google_packages.dart';
import 'package:pub_api_client/src/helpers/google_packages_list.dart';
import 'package:pub_api_client/src/version.dart';
import 'package:pubspec_yaml/pubspec_yaml.dart';

import 'package:test/test.dart';

Expand Down Expand Up @@ -31,7 +34,7 @@ dynamic Function() overridePrint(dynamic Function() testFn) => () {
return Zone.current.fork(specification: spec).run(testFn);
};
void main() {
group('Console Helper', () {
group('Helpers', () {
test('Check Update Printer', overridePrint(() async {
await checkUpdatePrinter(packageName);
expect(printLog.isEmpty, true);
Expand All @@ -44,5 +47,12 @@ void main() {
// print(googleDeps);
expect(googleDeps.length, googlePackagesList.length);
});

test('Does Package version match', () async {
final pubspec = File(
'${Directory.current.path}/pubspec.yaml',
).readAsStringSync().toPubspecYaml();
expect(pubspec.version.valueOr(() => null), packageVersion);
});
});
}

0 comments on commit 8f334d7

Please sign in to comment.