Sha256: 30ad98516c17c6e23efb5f028ac95d4c6db725b031ecac8f6131a9dfb7527836

Contents?: true

Size: 893 Bytes

Versions: 1

Compression:

Stored size: 893 Bytes

Contents

require 'rspec'
require 'require_all'      
require 'active_support/inflector'      

module RSpec
  module RubyContentMatchers
  end
end

require 'code_spec/matchers/content_matcher'
require_all File.dirname(__FILE__) + '/code_spec/matchers'

require_all File.dirname(__FILE__) + '/code_spec/erb'

require 'code_spec/content_helpers'
require 'code_spec/core_ext'

module FormHelperMacro  
  def with_form_helper name
    class_eval do
      include get_form_matcher(name)
    end
  end
  
  protected

  def get_form_matcher name
    case name
    when :formtastic
      Erb::Formtastic::ContentMatchers
    when :simpleform
      Erb::SimpleForm::ContentMatchers
    else
      Erb::RailsForm::ContentMatchers
    end    
  end  
end
 

RSpec.configure do |config|
  config.include RSpec::RubyContentMatchers 
  config.extend(FormHelperMacro) 
end

                                       


Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
code-spec-0.1.3 lib/code-spec.rb