So I'd set this text up so that it's using the js grammar (which has indent rules) just for this spec and then reset it so it doesn't affect the other specs.

Here are a few examples of the calls that you'll need in order to do this.
https://github.com/atom/grammar-selector/blob/master/lib/grammar-list-view.coffee#L36
https://github.com/atom/grammar-selector/blob/master/spec/grammar-selector-spec.coffee#L28
https://github.com/atom/grammar-selector/blob/master/spec/grammar-selector-spec.coffee#L40

Does that help?