Files
react-native/scripts/cocoapods/__tests__/test_utils/Open3Mock.rb
T
Riccardo Cipolleschi 468b86bd37 Move Hermes setup in a dedicated ruby file (#34100)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/34100

This Diff continue the effort of refactor and test the cocoapods script, moving hermes setup in a dedicated `hermes.rb` file and adding some tests on the logic of the hermes handling.

## Changelog
[iOS][Changed] - move and test Hermes setup from react_native_pods script into a dedicated file

Reviewed By: cortinico

Differential Revision: D37522432

fbshipit-source-id: 91112476aac576a30110e5dcd4e46fa12241962a
2022-07-08 07:25:29 -07:00

44 lines
953 B
Ruby

# Copyright (c) Meta Platforms, Inc. and affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
class Open3
@@collected_commands = []
@@collected_dirs = []
@@returned_text = ""
@@returned_status = 0
def self.capture2e(command, chdir: ".")
@@collected_commands.push(command)
@@collected_dirs.push(chdir)
return [*@@returned_text, @@returned_status]
end
def self.collected_commands
return @@collected_commands
end
def self.collected_dirs
return @@collected_dirs
end
def self.set_returned_text(text)
@@returned_text = text
end
def self.set_returned_status(status)
@@returned_status = status
end
def self.reset()
@@collected_commands = []
@@collected_dirs = []
@@returned_text = ""
@@returned_status = 0
end
end