Sha256: b4e85d73774f9e27040eef99a41640579f742bb772f985ac1c8e88026eb7cfe1

Contents?: true

Size: 857 Bytes

Versions: 2

Compression:

Stored size: 857 Bytes

Contents

module RSpec
  module Generator
    module Helpers
      def check_file file, type=nil, &block
        self.should generate_file(file, type, &block)
      end
      alias_method :file, :check_file

      def check_view(file_name, matchings)
        self.should generate_file(filename, :view) do |content|  
          check_matchings matchings
        end
      end
      alias_method :view, :check_view

      def check_model(name, clazz, options = {})
        self.should generate_file("#{name.underscore}.rb", :model) do |file_content|
          file_content.should have_class clazz do |content|
            check_matchings options[:matchings]    
            check_methods(options[:methods])
            check_class_methods(options[:class_methods])
          end
        end            
      end
      alias_method :model, :check_model
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
rspec_for_generators-0.3.1 lib/rspec_for_generators/matchers/helpers/file.rb
rspec_for_generators-0.3.0 lib/rspec_for_generators/matchers/helpers/file.rb