File tree Expand file tree Collapse file tree 3 files changed +56
-1
lines changed
Expand file tree Collapse file tree 3 files changed +56
-1
lines changed Original file line number Diff line number Diff line change 11## NEXT
22
33- feat: Allow overriding client environment with Dart define
4+ - fix: Searching parent directories for a ` pubspec.yaml ` file always halts now
45- chore: Update dependencies
56
67## 1.0.13
Original file line number Diff line number Diff line change @@ -185,7 +185,7 @@ base mixin Configure on CelestCommand {
185185 } else {
186186 // For other commands, search recursively for the Celest pubspec file.
187187 while (! pubspecFile.existsSync ()) {
188- if (currentDir == currentDir.parent) {
188+ if (fileSystem. identicalSync ( currentDir.path, currentDir.parent.path) ) {
189189 _throwNoProject ();
190190 }
191191 currentDir = currentDir.parent;
Original file line number Diff line number Diff line change 1+ import 'package:celest_cli/src/commands/celest_command.dart' ;
2+ import 'package:celest_cli/src/context.dart' ;
3+ import 'package:celest_cli/src/exceptions.dart' ;
4+ import 'package:celest_cli/src/init/project_init.dart' ;
5+ import 'package:mason_logger/src/mason_logger.dart' ;
6+ import 'package:test/test.dart' ;
7+
8+ final class TestCommand extends CelestCommand with Configure {
9+ @override
10+ String get name => 'test' ;
11+
12+ @override
13+ String get description => 'test' ;
14+
15+ @override
16+ Progress ? currentProgress;
17+
18+ @override
19+ // ignore: must_call_super
20+ Future <int > run () async {
21+ await configure ();
22+ return 0 ;
23+ }
24+ }
25+
26+ void main () {
27+ group ('init' , () {
28+ test ('throws when no project found' , () async {
29+ final projectRoot = await fileSystem.systemTempDirectory.createTemp (
30+ 'test_project_' ,
31+ );
32+ fileSystem.currentDirectory = projectRoot;
33+
34+ addTearDown (() async {
35+ try {
36+ await projectRoot.delete (recursive: true );
37+ } on Object {
38+ // OK
39+ }
40+ });
41+
42+ await expectLater (
43+ () => TestCommand ().run (),
44+ throwsA (
45+ isA <CliException >().having (
46+ (e) => e.message,
47+ 'message' ,
48+ contains ('No Celest project found in the current directory' ),
49+ ),
50+ ),
51+ );
52+ });
53+ });
54+ }
You can’t perform that action at this time.
0 commit comments