[rspec-users] (no subject)

David Chelimsky dchelimsky at gmail.com
Thu Jun 21 12:15:06 EDT 2007


On 6/21/07, Tom Locke <tom at hobocentral.net> wrote:
> Thanks David,
>
> I'm not sure this covers my situation though - I'll give a bit more
> detail
>
> The class I'm specing is the DRYML compiler -- yep I'm doing
> retroactive specing I'm afraid, which is maybe why things don't fit
> too neatly.
>
> You instantiate the class, passing the DRYML source, and then call
> process_src which converts the DRYML to regular ERB, and returns that
> as a string.
>
> At the moment I'm doing stuff like this:
>
> describe Template do
>
>    it "should compile tag calls to method calls" do
>      compile_dryml("<foo/>").should == "<%= foo() %>"
>    end
>
>    it "should compile attributes as keyword parameters" do
>      compile_dryml("<foo a='1'/>").should == '<%= foo({:a => "1"}) %>'
>    end
>
> end
>
> Those compile_dryml calls each instantiate a template with a
> different state. I really don't want to have a separate describe
> block for each example - there could be hundreds. Is this bad form?

Not at all. Perfectly sane.


>
> Tom
>
> _______________________________________________
> rspec-users mailing list
> rspec-users at rubyforge.org
> http://rubyforge.org/mailman/listinfo/rspec-users
>


More information about the rspec-users mailing list