Skip to content

Commit

Permalink
Merge pull request #45 from christophgockel/trim-selectors
Browse files Browse the repository at this point in the history
Trims selector strings to ignore whitespaces
  • Loading branch information
searls committed Sep 29, 2015
2 parents 9b7bf6f + 8558b77 commit 6690075
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion app/js/jasmine-fixture.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@

create = (selectorOptions, attach) ->
$top=null
_(selectorOptions.split(/[ ](?![^\{]*\})(?=[^\]]*?(?:\[|$))/)).inject(($parent, elementSelector) ->
_(selectorOptions.trim().split(/[ ](?![^\{]*\})(?=[^\]]*?(?:\[|$))/)).inject(($parent, elementSelector) ->
return $parent if elementSelector == ">"
$el = createHTMLBlock($,elementSelector)
$el.appendTo($parent) if attach || $top
Expand Down
3 changes: 2 additions & 1 deletion spec/jasmine-fixture-spec.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@ describe "jasmine.fixture", ->
'#toddler .hidden.toy input[name="toyName"][value="cuddle bunny"]' #<div id="toddler"><div class="hidden toy"><input name="toyName" value="cuddle bunny"></div></div>
'select[name="date[year]"]' #<select name="date[year]"></select>
'input[name="some[thing][foo]"]'
'input[type="text"][value="4.99"][class="class-name"]'
'input[type="text"][value="4.99"][class="class-name"]',
' #foo .bar '
]

describe ".affix", ->
Expand Down

0 comments on commit 6690075

Please sign in to comment.