Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
chai-backbone-rails gem
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  5 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Matthijs Groen  
View profile  
 More options Sep 29 2012, 4:43 pm
From: Matthijs Groen <matthijs.gr...@gmail.com>
Date: Sat, 29 Sep 2012 13:43:01 -0700 (PDT)
Local: Sat, Sep 29 2012 4:43 pm
Subject: chai-backbone-rails gem

I created a gem bundling the matchers I use a lot now in multiple projects.

https://github.com/matthijsgroen/chai-backbone-rails/tree/master/vend...

In short this library consists of 4 parts:

- Backbone specific matchers
  'home/hello'.should.route.to router, 'method', arguments: 'hello'
  model.should.trigger('change').when -> model.set attr: 'value'

- Sinon matchers
- Change matchers
  expect(-> result).to.change.by(3).when -> result += 3
  expect(-> result).to.change.to(5).when -> result = 5

- Factories
  Factory.define 'user', (attributes = {}, traits...) ->
    new Backbone.Model attributes
  Factory.create 'user'

  support for sequences and traits is also there.

I would like to make these files into some sort of Chai-Plugin that could
be listed on the site, what should the steps be to make this happen?

ps. tests are also included in the vendor/assets/javascripts/spec/ folder

The idea of this gem is that konacha users can just add this gem and use it
in their spec_helper straight away without needing to update the .js files
everytime


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Jake L.  
View profile  
 More options Oct 1 2012, 6:18 pm
From: "Jake L." <jake.l...@gmail.com>
Date: Mon, 1 Oct 2012 15:18:58 -0700 (PDT)
Local: Mon, Oct 1 2012 6:18 pm
Subject: Re: chai-backbone-rails gem

This is awesome! A few suggestions to get you on a path so we can get this
on the site ASAP.

Can you separate the backbone, sinon, and change into their own java/coffee
script project(s)? The website requires a `package.json` and a readme flie
in order to correctly dynamically populate the info page on the site. The
best example of this is chai-jquery:

Javascript project: https://github.com/chaijs/chai-jquery
Konacha wrapper: https://github.com/wordofchristian/chai-jquery-rails
Chai website
entry: https://github.com/chaijs/chai-docs/blob/master/plugins.js#L55-65

I suggest using node.js to setup the plugin repos, that ensures you always
have the most recent chai and mocha to work from. Also, by separating out
the actual plugins into pure JS files, non-rails users can also use these
(and I know several node devs who have been looking for a backbone plugin).

Also note, there is already a `sinon-chai` plugin, but since yours behaves
a bit differently I have no objection to including it on the site. It will,
however, be up to you on how to best differentiate yourself. Also, please
don't select that exact name as that will cause conflicts in the website
url generation scheme.

Once your done, I would also suggest contacting John Firebaugh (Konacha
project owner) about having your Konacha wrappers included in the konacha
readme somewhere.

I hope this helps get you started. Feel free to post additional questions
here.

Good Luck,
Jake


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Matthijs Groen  
View profile  
 More options Oct 3 2012, 3:05 pm
From: Matthijs Groen <matthijs.gr...@gmail.com>
Date: Wed, 3 Oct 2012 21:05:19 +0200
Local: Wed, Oct 3 2012 3:05 pm
Subject: Re: chai-backbone-rails gem

I think I will eventually split it up in 3 parts:

- Factories (I know there is a chai factories plugin but it is not as
feature rich as a I needed)
- Backbone (and I move the 'sinon' matchers I use the most under there)
- Changes (and the backbone gem will then have a dependency to changes,
since it also uses the 'when' construct)


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Jake L.  
View profile  
 More options Oct 5 2012, 7:50 pm
From: "Jake L." <jake.l...@gmail.com>
Date: Fri, 5 Oct 2012 16:50:53 -0700 (PDT)
Local: Fri, Oct 5 2012 7:50 pm
Subject: Re: chai-backbone-rails gem

Got `chai-changes` up on the site. Looks good. Let me know if your
interested getting it working on node at some point. That might be
interesting.

Looking forward to the rest!


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Matthijs Groen  
View profile  
 More options Oct 7 2012, 5:35 pm
From: Matthijs Groen <matthijs.gr...@gmail.com>
Date: Sun, 7 Oct 2012 23:35:54 +0200
Local: Sun, Oct 7 2012 5:35 pm
Subject: Re: chai-backbone-rails gem

I will be on a short vacation this week, but able to test it in node the
week thereafter. I will also try to finish the remaining parts.

Thanks for listing it on the site and the support!


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »