use of com.facebook.buck.android.AndroidBuildConfig.ReadValuesStep in project buck by facebook.
the class AndroidBuildConfigTest method testReadValuesStep.
@Test
public void testReadValuesStep() throws IOException {
Path pathToValues = Paths.get("src/values.txt");
ProjectFilesystem projectFilesystem = EasyMock.createMock(ProjectFilesystem.class);
EasyMock.expect(projectFilesystem.readLines(pathToValues)).andReturn(ImmutableList.of("boolean DEBUG = false", "String FOO = \"BAR\""));
EasyMock.replay(projectFilesystem);
ReadValuesStep step = new ReadValuesStep(projectFilesystem, pathToValues);
ExecutionContext context = TestExecutionContext.newBuilder().build();
int exitCode = step.execute(context).getExitCode();
assertEquals(0, exitCode);
assertEquals(BuildConfigFields.fromFields(ImmutableList.of(BuildConfigFields.Field.of("boolean", "DEBUG", "false"), BuildConfigFields.Field.of("String", "FOO", "\"BAR\""))), step.get());
EasyMock.verify(projectFilesystem);
}
Aggregations