Sha256: 2f9bae3b76c5c9506bcb5b305fa90ea709815e2206255a02561a66b892be3b4f

Contents?: true

Size: 1.07 KB

Versions: 5

Compression:

Stored size: 1.07 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::RailsBestPractices.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

5 entries across 5 versions & 1 rubygems

Version Path
metric_fu-4.4.4 spec/metric_fu/metrics/rails_best_practices/rails_best_practices_spec.rb
metric_fu-4.4.3 spec/metric_fu/metrics/rails_best_practices/rails_best_practices_spec.rb
metric_fu-4.4.2 spec/metric_fu/metrics/rails_best_practices/rails_best_practices_spec.rb
metric_fu-4.4.1 spec/metric_fu/metrics/rails_best_practices/rails_best_practices_spec.rb
metric_fu-4.4.0 spec/metric_fu/metrics/rails_best_practices/rails_best_practices_spec.rb