Re: [Radiant] Proper Extension Testing

2008-04-29 Thread Sean Cribbs
'autotest' _should_ work for testing your extensions, but it will run constantly in the background. Otherwise, just pass EXT=my_extension_name to rake: rake spec:extensions EXT=my_extension_name Sean Chris Parrish wrote: One other thing. Is there a rake task to just run the specs for your

Re: [Radiant] Proper Extension Testing

2008-04-29 Thread Chris Parrish
One other thing. Is there a rake task to just run the specs for your extension? I see 'rake spec:extensions' but that runs all the extension specs (including the built-in ones included with Radiant). Is there something like 'rake spec:extensions:my_extension_name' During the development of

Re: [Radiant] Proper Extension Testing

2008-04-29 Thread Chris Parrish
Man! I'm always so impressed with how "on the ball" you are. Thanks for another super-quick reply. As for my 2nd question, I'm trying to follow BDD principles and write my specs before putting in any code. I was about to tackle the issue where my extension allows the user to define configu

Re: [Radiant] Proper Extension Testing

2008-04-29 Thread Chris Parrish
Great point Jim. I just stole this spec from the Radiant code (from snippet_spec.rb). Maybe I'll submit a patch for them too :-) . -Chris Jim Gay wrote: I would add that your spec should be more specific. When all of your specs are generated they should be clear. it "should validate format o

Re: [Radiant] Proper Extension Testing

2008-04-29 Thread Jim Gay
I would add that your spec should be more specific. When all of your specs are generated they should be clear. it "should validate format of name" gives you no information about what that format should be. Your spec should describe how the application functions, so if it were me, I'd write my

Re: [Radiant] Proper Extension Testing

2008-04-29 Thread Sean Cribbs
Chris, For your first question: it 'should insert an admin tab' do Radiant::AdminUI.instance.tabs.any? {|tab| tab.name == "My Tab" }.should be_true end Not sure what you mean to be testing in your second question. In your third, I would avoid using the validations test_helper. Instead do

[Radiant] Proper Extension Testing

2008-04-29 Thread Chris Parrish
So I am writing my first rSpec 'tests' formally and I'm running up against some questions on making this work within Radiant. Can anyone shed some light on how to spec for the following items: * My extension should create a tab in the Admin UI. It should be before or after certain oth