Sha256: f4e36dcf08211e80858e84e282931d1f1db5a0f9976921ebe2f5ae3205398f71
Contents?: true
Size: 1.24 KB
Versions: 1
Compression:
Stored size: 1.24 KB
Contents
# open application_file # see if there is the config.[statement] = [expr] require 'sugar-high/kind_of' require 'sugar-high/array' module RSpec::RailsApp::Content module Matchers class HaveGems extend Rails3::Assist::UseMacro use_helpers :file attr_reader :names, :name def initialize *names @names = names.to_strings end # TODO: relative to root_path ? def matches?(root_path=nil) content = read_gemfile return nil if content.empty? names.each do |name| (content =~ /gem\s+#{name_expr(name)}/) end end def name_expr gem_name @name = gem_name "('|\")" + gem_name + '\1' end def msg "the Gemfile to have a gem statement: gem '#{name}'" end def version_txt version ? ", '#{version}'" : "" end def failure_message "Expected #{msg}" end def negative_failure_message "Did not expect #{msg}" end end # config.autoload_paths += %W(#{Rails.root}/lib) # have_app_config :autoload_paths => '%W(#{Rails.root}/lib)', :op => '+=' def have_gems *names HaveGems.new *names end end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
rails-app-spec-0.2.7 | lib/rails_app_spec/matchers/special/have_gems.rb |