Class: Webspicy::Checker

Inherits:
Object
  • Object
show all
Defined in:
lib/webspicy/checker.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(config) ⇒ Checker

Returns a new instance of Checker.



4
5
6
# File 'lib/webspicy/checker.rb', line 4

def initialize(config)
  @config = Configuration.dress(config)
end

Instance Attribute Details

#configObject (readonly)

Returns the value of attribute config.



7
8
9
# File 'lib/webspicy/checker.rb', line 7

def config
  @config
end

Instance Method Details

#callObject



9
10
11
12
13
14
15
16
17
18
19
20
21
22
# File 'lib/webspicy/checker.rb', line 9

def call
  config.each_scope do |scope|
    scope.each_resource_file do |file, folder|
      RSpec.describe file.relative_to(folder).to_s do

        it 'meets the formal doc data schema' do
          Webspicy.resource(file.load, file, scope)
        end

      end
    end
  end
  RSpec::Core::Runner.run config.rspec_options
end