Skip to content
This repository has been archived by the owner on Aug 1, 2023. It is now read-only.

Commit

Permalink
support and require fbexpect 2.6.1+
Browse files Browse the repository at this point in the history
  • Loading branch information
jjergus committed Oct 24, 2019
1 parent d3add4d commit 7998913
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 9 deletions.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"hhvm/hhast": "^4.6",
"hhvm/hhvm-autoload": "^2.0",
"hhvm/hacktest": "^1.1",
"facebook/fbexpect": "^2.1",
"facebook/fbexpect": "^2.6.1",
"usox/hackttp": "^0.3"
},
"extra": {
Expand Down
6 changes: 3 additions & 3 deletions tests/RouterCLILookupCodegenBuilderTest.hack
Original file line number Diff line number Diff line change
Expand Up @@ -81,10 +81,10 @@ final class RouterCLILookupCodegenBuilderTest extends BaseCodegenTestCase {
);
$output = \implode("\n", $output);
expect($exit_code)->toBeGreaterThan(0);
expect($output)->toNotContain('HEAD');
expect($output)->toNotContain('GET');
expect($output)->toNotContainSubstring('HEAD');
expect($output)->toNotContainSubstring('GET');
// Brittle - don't care about this string, just that there's a friendly
// error message rather than a hack error, exception, etc
expect($output)->toContain('No controller found');
expect($output)->toContainSubstring('No controller found');
}
}
11 changes: 6 additions & 5 deletions tests/RouterCodegenBuilderTest.hack
Original file line number Diff line number Diff line change
Expand Up @@ -71,14 +71,14 @@ final class RouterCodegenBuilderTest extends BaseCodegenTestCase {

public async function testMapOnlyContainsUsedMethods(): Awaitable<void> {
$code = $this->renderToString(await $this->getBuilderAsync());
expect($code)->toContain('HttpMethod::GET');
expect($code)->toNotContain('HttpMethod::POST');
expect($code)->toContainSubstring('HttpMethod::GET');
expect($code)->toNotContainSubstring('HttpMethod::POST');
}

public async function testDefaultGeneratedFrom(): Awaitable<void> {
$code = $this->renderToString(await $this->getBuilderAsync());
expect($code)->toContain('To re-generate this file run');
expect($code)->toContain('vendor/hhvm/hacktest/bin/hacktest');
expect($code)->toContainSubstring('To re-generate this file run');
expect($code)->toContainSubstring('vendor/hhvm/hacktest/bin/hacktest');
}

public async function testOverriddenGeneratedFrom(): Awaitable<void> {
Expand All @@ -87,7 +87,8 @@ final class RouterCodegenBuilderTest extends BaseCodegenTestCase {
$this->getCodegenFactory()->codegenGeneratedFromClass(self::class),
),
);
expect($code)->toContain('Generated from '.RouterCodegenBuilder::class);
expect($code)
->toContainSubstring('Generated from '.RouterCodegenBuilder::class);
}

public async function testCreatesFinalByDefault(): Awaitable<void> {
Expand Down

0 comments on commit 7998913

Please sign in to comment.