Sha256: 15b3851c422c1e9515ab4bc23313126443a73965d04c457180ac010a1c85f1da
Contents?: true
Size: 1.17 KB
Versions: 8
Compression:
Stored size: 1.17 KB
Contents
require "spec_helper" MetricFu.metrics_require { 'rails_best_practices/rails_best_practices' } 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 { expect(analyzer).to respond_to :analyze } it { expect(analyzer).to respond_to :errors } end end describe "analyze method" do let(:error) { ::RailsBestPractices::Core::Error.new } context "RailsBestPractices provdies the expected API" do it { expect(error).to respond_to :filename } it { expect(error).to respond_to :line_number } it { expect(error).to respond_to :message } it { expect(error).to 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") expect(practices.to_h[:rails_best_practices]).to eq("the_practices") end end end
Version data entries
8 entries across 8 versions & 1 rubygems