Question about aliases: Describe/it, context/should

1 view
Skip to first unread message

Choan Gálvez

unread,
Feb 22, 2009, 4:59:31 PM2/22/09
to jsho...@googlegroups.com
Hi all.

A VIP user of jShoulda has requested to get the describe/it aliases
exported by default. That is, if you're using tests like this:

describe("A context",
it("run tests", function() {
})
)();

You would not need to create the aliases by yourself –please take a
look at <http://jshoulda.scriptia.net/tutorial/#aliasing> if you don't
know what we are talking about.

As every alias is exported to the global context/window object, I'm
reluctant to extend the list of default exported aliases.

These are the symbols created currently by jShoulda in the global space:

* jShoulda
* should
* context

Three symbols. Quite good. Adding 'describe' and 'it' would raise the
number of symbols to five. Not so good –at least for me.

So, I need your feedback.

* Which aliases are you using?
* Is it too much work to set them through `setContextAlias` and
`setShouldAlias`?
* Is five an acceptable number of global symbols for you?
* Do you consider that any of should/context/describe/it symbols may
conflict with your own global symbols or with any symbol from other
library?
* Would you consider reasonable to remove **every global alias**
created by jShoulda (including 'context' and 'should') and set them
through something like `jShoulda.setStyle('should')` or
`jShoulda.setStyle('describe')`?
* Do you think my handsomeness increases with every question I ask? XD

Please, participate.

Best.
--
Choan
<http://choangalvez.nom.es/>

Dr Nic Williams

unread,
Feb 22, 2009, 5:08:49 PM2/22/09
to jsho...@googlegroups.com
I like the setStyle("describe") initialiser. 

Personally I prefer the context/should; esp since the jShoulda tmbundle has snippets for them (though these could be made to be flexible using Preferences for what its worth).

Cheers
Nic
--
Dr Nic Williams
Mocra - Premier iPhone and Ruby on Rails Consultants
w - http://mocra.com
e - dr...@mocra.com
p - +61 412 002 126 or +61 7 3102 3237
skype - nicwilliams

Choan Gálvez

unread,
Feb 22, 2009, 5:37:16 PM2/22/09
to jsho...@googlegroups.com
On Feb 22, 2009, at 23:08 , Dr Nic Williams wrote:

> I like the setStyle("describe") initialiser.

I like it too.

> Personally I prefer the context/should; esp since the jShoulda
> tmbundle has
> snippets for them (though these could be made to be flexible using
> Preferences for what its worth).

Did that months ago, but never pushed. It's live on Github right now.

Reply all
Reply to author
Forward
0 new messages