Sha256: a5582ee45d554626904d0ebb86af44b7d5de95bd515ba614980a693494413550

Contents?: true

Size: 624 Bytes

Versions: 1

Compression:

Stored size: 624 Bytes

Contents

require 'test_helper'
require 'rubycritic/generators/html/turbulence'

describe RubyCritic::Turbulence do
  describe '::data' do
    it 'returns json data that maps pathname, churn and complexity to name, x and y' do
      files = [AnalysedModuleDouble.new(name: 'Foo', churn: 1, complexity: 2)]
      turbulence_data = RubyCritic::Turbulence.data(files)
      instance_parsed_json = JSON.parse(turbulence_data).first
      instance_parsed_json['name'].must_equal 'Foo'
      instance_parsed_json['x'].must_equal 1
      instance_parsed_json['y'].must_equal 2
    end
  end
end

class AnalysedModuleDouble < OpenStruct; end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
rubycritic-2.9.3 test/lib/rubycritic/generators/turbulence_test.rb