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

Improved the README #52

Merged
merged 1 commit into from Mar 26, 2016
Merged

Improved the README #52

merged 1 commit into from Mar 26, 2016

Conversation

ujh
Copy link
Collaborator

@ujh ujh commented Mar 17, 2016

Recently a few people (e.g. @grosser & @xetra11) had issues with stainless mainly due to the lack of documentation. I've tried to clarify the README a bit. See here for how Github would render it.

  • Added note about the fact that the nightly compiler build is required
  • Added instructions on how to integrate stainless
  • Reordered sections (overview before the example)
  • Added before_each & after_each to the nested describe! in the example
  • Clarified the pub use requirement

@grosser
Copy link

grosser commented Mar 17, 2016

❤️


Add stainless as a dependency in your `Cargo.toml` file
``` toml
[dependencies]
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this should be a dev-dependency

@reem
Copy link
Owner

reem commented Mar 17, 2016

Thanks for this. It looks great except for the one nit.

* Added note about the fact that the nightly compiler build is required
* Added instructions on how to integrate stainless
* Reordered sections (overview before the example)
* Added `before_each` & `after_each` to the nested `describe!` in the example
* Clarified the `pub use` requirement
@ujh
Copy link
Collaborator Author

ujh commented Mar 18, 2016

Oh yes, of course! Fixed.

@grosser
Copy link

grosser commented Mar 19, 2016

followed the instructions ... still getting

hello.rs:7:5: 7:13 error: macro undefined: 'describe!'
hello.rs:7     describe! canvas_renderer {
               ^~~~~~~~
rustc --version
rustc 1.9.0-nightly (6e0f2f2f0 2016-03-16)
#![feature(plugin)]
#![cfg_attr(test, plugin(stainless))]

#[cfg(test)]
mod tests {
    pub use std::collections::HashMap;

    describe! stainless {
        it "can use HashMap" {
            let map = HashMap::new();
        }
    }
}

@ujh
Copy link
Collaborator Author

ujh commented Mar 19, 2016

How are you running this? Via cargo test?

@grosser
Copy link

grosser commented Mar 19, 2016

yep!

@grosser
Copy link

grosser commented Mar 19, 2016

@ujh
Copy link
Collaborator Author

ujh commented Mar 19, 2016

You haven't put the two lines at the top of hello.rs in your repo. This works for me:

[package]
name = "t"
version = "0.0.0"

[lib]
path = "hello.rs"

[dev-dependencies]
stainless = "*"
#![feature(plugin)]
#![cfg_attr(test, plugin(stainless))]

#[cfg(test)]
mod tests {
    pub use std::collections::HashMap;

    describe! stainless {
        it "can use HashMap" {
            let mut map = HashMap::new();
            map.insert(1, 1);
            assert!(map.contains_key(&1));
    }
    }
}
Compilation started at Sat Mar 19 19:56:06

cargo test
   Compiling t v0.0.0 (file:///Users/uh/t)
     Running target/debug/t-aede725b5ddfcc52

running 1 test
test tests::stainless::can_use_HashMap ... ok

test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured

   Doc-tests t

running 0 tests

test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured


Compilation finished at Sat Mar 19 19:56:07

@grosser
Copy link

grosser commented Mar 20, 2016

copy pasted these changes and still getting the same error :D

pushed it with the changes ... that version works for you ?

what rust version are you running ? ... I'm on rustc 1.9.0-nightly (6e0f2f2f0 2016-03-16)

@reem
Copy link
Owner

reem commented Mar 26, 2016

Thank you!

@reem reem merged commit ae69bc0 into reem:master Mar 26, 2016
@xetra11
Copy link

xetra11 commented Jun 11, 2016

thanks for that !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants