Created
July 29, 2010 00:18
-
-
Save dchelimsky/496834 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module MyModule | |
SUBTESTS = %w[foo bar baz] | |
end | |
describe "#add_question_set_of_type" do | |
MyModule::SUBTESTS.each do |subtest| | |
describe %Q("#{subtest}") do | |
let(:subtest) { "#{subtest} in let" } | |
before { @subtest = "#{subtest} in before" } | |
it "does something" do | |
p subtest | |
p @subtest | |
end | |
end | |
end | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ spec example_spec.rb | |
"foo" | |
"foo in before" | |
."bar" | |
"bar in before" | |
."baz" | |
"baz in before" | |
. | |
Finished in 0.007255 seconds | |
3 examples, 0 failures |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ rspec example_spec.rb | |
"foo" | |
"foo in before" | |
."bar" | |
"bar in before" | |
."baz" | |
"baz in before" | |
. | |
Finished in 0.00126 seconds | |
3 examples, 0 failures |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment