Skip to content

Commit

Permalink
Add switching platform
Browse files Browse the repository at this point in the history
  • Loading branch information
m3m0r7 committed Sep 24, 2023
1 parent d9c6079 commit b85f179
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/php.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,4 +54,4 @@ jobs:
./composer.phar install
- name: Run test
run: |
./vendor/bin/phpunit tests/
ENV=ci ./vendor/bin/phpunit tests/
5 changes: 5 additions & 0 deletions tests/Helper/TestApplication.php
Original file line number Diff line number Diff line change
Expand Up @@ -65,4 +65,9 @@ protected function createRubyVMFromCode(string $code, string $extraData = '', st
$stdErr,
);
}

protected function isCI(): bool
{
return ($_ENV['ENV'] ?? null) === 'ci';
}
}
6 changes: 5 additions & 1 deletion tests/Version/Ruby3_2/YARBStructureTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,11 @@ public function testHeader(): void
);
$rubyVMManager->rubyVM->runtime()->setup();
$this->assertSame('3.2', $rubyVMManager->rubyVM->runtime()->rubyVersion());
$this->assertSame('arm64-darwin22', $rubyVMManager->rubyVM->runtime()->rubyPlatform());
if ($this->isCI()) {
$this->assertSame('x86_64-linux', $rubyVMManager->rubyVM->runtime()->rubyPlatform());
} else {
$this->assertSame('arm64-darwin22', $rubyVMManager->rubyVM->runtime()->rubyPlatform());
}
}

public function testExtraData(): void
Expand Down

0 comments on commit b85f179

Please sign in to comment.