Skip to content

Instantly share code, notes, and snippets.

@okitan
Created July 12, 2011 02:58
Show Gist options
  • Save okitan/1077307 to your computer and use it in GitHub Desktop.
Save okitan/1077307 to your computer and use it in GitHub Desktop.
こういうのがいいかな
each_context {
'Aの場合' => { :key => 'a' },
'Bの場合' => { :key => 'b' },
} do
it { ... }
end
__EOF__
{
'Aの場合' => { :key => 'a' },
'Bの場合' => { :key => 'b' },
}.each do |desc, opt|
context(desc) do
before(:all) { __memorized.clear }
before(:all) { opt.each {|k, v| self.class.let(k) { value } }
it { ... }
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment