diff options
author | André Zanellato <30451287+AZanellato@users.noreply.github.com> | 2019-08-13 19:43:29 -0300 |
---|---|---|
committer | Matan Kushner <hello@matchai.me> | 2019-08-13 18:43:29 -0400 |
commit | b06249d61c98813bf56c5c9fdc7d974a35b61dad (patch) | |
tree | bf13e98ea264925b7a99e762e4be36ae67cc5cff /tests/testsuite/ruby.rs | |
parent | f10bfe4616794967e9014c978c3819e91634e4d6 (diff) |
feat: implement the ruby module (#131)
Diffstat (limited to 'tests/testsuite/ruby.rs')
-rw-r--r-- | tests/testsuite/ruby.rs | 52 |
1 files changed, 52 insertions, 0 deletions
diff --git a/tests/testsuite/ruby.rs b/tests/testsuite/ruby.rs new file mode 100644 index 000000000..f8a4356a1 --- /dev/null +++ b/tests/testsuite/ruby.rs @@ -0,0 +1,52 @@ +use ansi_term::Color; +use std::fs::{self, File}; +use std::io; + +use crate::common; + +#[test] +fn folder_without_ruby_files() -> io::Result<()> { + let dir = common::new_tempdir()?; + + let output = common::render_module("ruby") + .arg("--path") + .arg(dir.path()) + .output()?; + let actual = String::from_utf8(output.stdout).unwrap(); + + let expected = ""; + assert_eq!(expected, actual); + Ok(()) +} + +#[test] +fn folder_with_gemfile() -> io::Result<()> { + let dir = common::new_tempdir()?; + File::create(dir.path().join("Gemfile"))?; + + let output = common::render_module("ruby") + .arg("--path") + .arg(dir.path()) + .output()?; + let actual = String::from_utf8(output.stdout).unwrap(); + + let expected = format!("via {} ", Color::Red.bold().paint("💎 v2.5.5")); + assert_eq!(expected, actual); + Ok(()) +} + +#[test] +fn folder_with_rb_file() -> io::Result<()> { + let dir = common::new_tempdir()?; + File::create(dir.path().join("any.rb"))?; + + let output = common::render_module("ruby") + .arg("--path") + .arg(dir.path()) + .output()?; + let actual = String::from_utf8(output.stdout).unwrap(); + + let expected = format!("via {} ", Color::Red.bold().paint("💎 v2.5.5")); + assert_eq!(expected, actual); + Ok(()) +} |