carols10cents / cargo-open

A third-party cargo extension to allow you to open a dependent crate in your $EDITOR
Apache License 2.0
22 stars 5 forks source link

[Test] 3 env vars, no env vars #2

Closed marti1125 closed 8 years ago

marti1125 commented 8 years ago

Could you explain me more, please? I don't have much experience with Rust =)

carols10cents commented 8 years ago

Sure! By this one, I meant to add tests around the behavior of checking the environment variables $CARGO_EDITOR, then $VISUAL, then $EDITOR, stopping and using the value if one is set, and if none of them are set, printing an error that guides the user to setting one.

I'm actually not sure how I'm going to do tests at all yet-- I'm probably going to model them after cargo's tests-- cargo has some nice test helpers and utilities for setting environment variables for running a process and setting up temporary test projects.

Please let me know if you have any more questions!!

marti1125 commented 8 years ago

ok, I understand. I am going to make a test where check env vars because by default in Mac is vim editor example :) http://stackoverflow.com/questions/25084035/setting-editor-or-bundler-editor-environment-variable

marti1125 commented 8 years ago

http://stackoverflow.com/questions/27840394/how-can-a-rust-program-access-metadata-from-its-cargo-package

marti1125 commented 8 years ago

hi @carols10cents any update?

carols10cents commented 8 years ago

Oooh I'm so sorry!! I missed your PR for some reason, and then I was out of town... taking a look now!!! :heart_decoration:

carols10cents commented 8 years ago

There are now tests for this!!