Skip to content

Instantly share code, notes, and snippets.

@otaviocardoso
otaviocardoso / matchers_helper.rb
Created October 9, 2012 21:33
Workaround para adicionar 'has_{no_}text?' em projeto com capybara 1.1
# all code from capybara master
module MatchersHelper
# Capybara::Helpers
def normalize_whitespace(text)
text.to_s.gsub(/[\s\u0085\u00a0\u1680\u180e\u2000-\u200a\u2028\u2029\u202f\u205f\u3000]+/, ' ').strip
end
def to_regexp(text)
text.is_a?(Regexp) ? text : Regexp.escape(normalize_whitespace(text))
end
@otaviocardoso
otaviocardoso / gist:3830099
Created October 3, 2012 21:50
Atualização de teste do filtro de sampler
@@ -8,33 +8,21 @@ describe Sampler do
describe "filter" do
shared_examples "a sampler filter" do |hash|
it "should return the correct sampler" do
- attrs = {}
- filter = {}
-
- hash.each do |key, value|
- attrs = attrs.merge({ key => value[:real_value] })
- end