Skip to content

Instantly share code, notes, and snippets.

@joshski
joshski / Find duplicate element ids with jquery
Created March 2, 2010 18:07
Find duplicate element ids with jquery
var idCounts = {};
$("*").each(function() {
if (this.id != '')
idCounts[this.id] = (idCounts[this.id] || 0) + 1;
});
for (var i in idCounts) {
if (idCounts[i] > 1)
console.log(i + "=" + idCounts[i]);
}
Feature: Anaphora example
Scenario: Punish bad pets
Given I am a pet owner
And I have a dog called Derek
And I have a cat called Connie
Then I should give them dinner
And I should not give them treats
When Derek barks at Connie
Then I should give Connie treats
Scenario Outline: whatever
Given '<user>' has full rights
Examples:
| user |
| Aidy |
require 'spec'
# i have an option box that stores text ("day", "week" or "month" -
# representing the accuracy of a date) to a database that is then used
# when displaying the date (i.e. decides what accuracy to show it to).
class Event
attr_accessor :date, :accuracy
def to_s
# example.feature
Feature: Example
Scenario: Eat
Given I am hungry
Then I should eat
# example_steps.rb