Skip to content
This repository has been archived by the owner on Oct 31, 2021. It is now read-only.

Update pubspec.yaml.mustache and minor patches #8

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion lib/src/commands/command.dart
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,11 @@ abstract class NgDartCommand extends Command {
args = args.skip(1).toList();

if (args.length > 0) {
throw new UsageException('Unexpected argument $args', '');
throw new UsageException(
'Unexpected argument' +
(args.length > 1 ? 's' : '') +
': ${args.toString().substring(1, args.toString().length - 2)}',
'');
}

return arg;
Expand Down
4 changes: 2 additions & 2 deletions lib/src/package_uri_resolver.dart
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ class PackageUriResolver {
} catch (e) {
throw new UsageException(
'Error when reading $_dotPackagesFilePath, '
'please run pub get first.',
'please run pub get first.',
'');
}

Expand All @@ -49,7 +49,7 @@ class PackageUriResolver {
if (_packageMap[packageName] == null) {
throw new UsageException(
'Cannot locate $packageName, '
'probably you need to run pub get again',
'probably you need to run pub get again',
'');
}

Expand Down
4 changes: 2 additions & 2 deletions lib/src/project_model.dart
Original file line number Diff line number Diff line change
Expand Up @@ -105,8 +105,8 @@ String _getProjectName(String pubspecFilePath) {
} catch (e) {
throw new UsageException(
'Error happened when reading pubspec.yaml. '
'Command generate test should be run '
'under root directory of the project.',
'Command generate test should be run '
'under root directory of the project.',
'');
}
var namePrefix = 'name:';
Expand Down
14 changes: 7 additions & 7 deletions lib/templates/project/pubspec.yaml.mustache
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@ version: 0.0.1
environment:
sdk: ">=2.0.0-dev.64.2 <3.0.0"
dependencies:
angular: ^5.0.0-beta+2
angular: ">=5.3.0"
dev_dependencies:
angular_test: ^2.0.0-beta+2
build_runner: ^0.9.2
build_test: ^0.10.3+1
build_web_compilers: ^0.4.1
pageloader: ^3.0.0-beta
test: ^1.3.0
angular_test: ^2.4.0
build_runner: ^1.8.1
build_test: ^1.0.0
build_web_compilers: ^2.10.0
pageloader: ^3.3.0
test: ^1.14.2
12 changes: 6 additions & 6 deletions test/page_object_data_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ void main() {
test('should generate items in parents list', () {
var po = new PageObjectData(
'<p *ngFor="xxx"><action-button class="good">'
'</action-button></p>',
'</action-button></p>',
);
expect(po.variables.first.getterString,
'Future<List<PageLoaderElement>> get good => _getGood();');
Expand All @@ -53,13 +53,13 @@ void main() {
test('should sort generated items', () {
var po1 = new PageObjectData(
'<action-button class="good"></action-button>'
'<action-button class="bad"></action-button>',
'<action-button class="bad"></action-button>',
);
expect(po1.variables.first.name, 'Bad');
expect(po1.variables.last.name, 'Good');
var po2 = new PageObjectData(
'<action-button class="good"></action-button>'
'<action-button class="bad"></action-button>',
'<action-button class="bad"></action-button>',
);
expect(po2.variables.first.name, 'Bad');
expect(po2.variables.last.name, 'Good');
Expand Down Expand Up @@ -91,8 +91,8 @@ void main() {
test('should choose correct selector.', () {
var po = new PageObjectData(
'<some-widget class="cool"></some-widget>'
'<some-widget class="cool" id="cooler"></some-widget>'
'<some-widget></some-widget>',
'<some-widget class="cool" id="cooler"></some-widget>'
'<some-widget></some-widget>',
);
expect(po.variables.length, 3);
expect(po.variables[0].selector.toString(), "@ByClass('cool')");
Expand All @@ -103,7 +103,7 @@ void main() {
test('should work with selectors with attributes', () {
var po = new PageObjectData(
'<some-cell class="field-class"></some-cell>'
'<some-cell id="fieldWithId"></some-cell>',
'<some-cell id="fieldWithId"></some-cell>',
);
expect(po.variables[0].selector.toString(), "@ByClass('field-class')");
expect(po.variables[1].selector.toString(), "@ById('fieldWithId')");
Expand Down