Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix test specs #778

Merged
merged 3 commits into from
Aug 22, 2021
Merged

Fix test specs #778

merged 3 commits into from
Aug 22, 2021

Conversation

cfurrow
Copy link
Contributor

@cfurrow cfurrow commented Aug 13, 2021

Fixes spec failures that I found when pulling down master on macOS, perhaps other envs too.

  1. Use Dir.tmpdir instead of the rspec-bash's create_stubbed_env #dir method, which does not seem to exist anymore?
  2. There seemed to be an invalid stubbing of the executor methods. The code uses DockerSync::Environment.system, but the spec expected it to be DockerSync::Dependencies::Docker::Driver.system
  3. Added more OS conditions for detecting .mac?, since .linux? did not capture it.
 Failure/Error: FileUtils.cp_r([host_app_template, config_file_template], env.dir)

      NoMethodError:
        undefined method `dir' for #<Rspec::Bash::StubbedEnv:0x00007fb0eeaf9988>
      Shared Example Group: "a synchronized directory" called from ./spec/integration/native-osx_strategy_spec.rb:43
      # ./spec/integration/native-osx_strategy_spec.rb:24:in `block (3 levels) in <top (required)>'

 CommandExecutionMock::CommandExecutionNotAllowed:
        Command execution is not allowed. Please stub the following call: __system_without_any_instance__("pgrep -q com.docker.hyperkit")
      # ./spec/helpers/command_mocking_helpers.rb:36:in `block in stub_command_executor'
      # ./lib/docker-sync/environment.rb:22:in `system'

@EugenMayer
Copy link
Owner

Thank you a lot for working on this!

@EugenMayer EugenMayer changed the title Fix specs Fix test specs Aug 22, 2021
@EugenMayer EugenMayer merged commit 702b717 into EugenMayer:master Aug 22, 2021
@EugenMayer EugenMayer added this to the 0.7.0 milestone Aug 22, 2021
@cfurrow
Copy link
Contributor Author

cfurrow commented Aug 22, 2021

No problem! I was going to look into updating this gem for Ruby 3.x+, but ran into some other issues along the way with Backticks/docker-compose and their own Ruby 3.x+ issues, so I have shelved that work for now 😀

@cfurrow cfurrow deleted the fix-specs branch August 22, 2021 18:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants