Sha256: 4c3b473013df58b20f5194ec5408ab5f29994dc5492b2ad99a7ac54687a56329

Contents?: true

Size: 1.08 KB

Versions: 3

Compression:

Stored size: 1.08 KB

Contents

require "spec_helper"

describe RailsBestPracticesGenerator do

  break if metric_not_activated?(:rails_best_practices)

  describe "emit method" do
    let(:analyzer) { ::RailsBestPractices::Analyzer.new('.', { 'silent' => true }) }
    context "RailsBestPractices provides the expected API" do
      it { analyzer.should respond_to :analyze }
      it { analyzer.should respond_to :errors }
    end
  end

  describe "analyze method" do
    let(:error) { ::RailsBestPractices::Core::Error.new }
    context "RailsBestPractices provdies the expected API" do
      it { error.should respond_to :filename }
      it { error.should respond_to :line_number }
      it { error.should respond_to :message }
      it { error.should respond_to :url }
    end
  end

  describe "to_h method" do
    it "should put things into a hash" do
      MetricFu::Configuration.run {}
      practices = MetricFu::RailsBestPracticesGenerator.new
      practices.instance_variable_set(:@rails_best_practices_results, "the_practices")
      practices.to_h[:rails_best_practices].should == "the_practices"
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
metric_fu-4.6.0 spec/metric_fu/metrics/rails_best_practices/rails_best_practices_spec.rb
metric_fu-4.5.2 spec/metric_fu/metrics/rails_best_practices/rails_best_practices_spec.rb
metric_fu-4.5.1 spec/metric_fu/metrics/rails_best_practices/rails_best_practices_spec.rb