Sha256: 75a4e323bc91d9b76b6131b1e75f962cdb91aa4d86c13cd2132db45d59733d5c

Contents?: true

Size: 634 Bytes

Versions: 8

Compression:

Stored size: 634 Bytes

Contents

RSpec.shared_examples 'a checker' do
  let(:checker){ described_class.new(double('SourceFile', :null_object => true)) }
  %w(name hint check).each do |method|
    it "should respond to :#{method}" do
      expect(checker).to respond_to(method.to_sym)
    end
  end
  %w(name hint).each do |method|
    it "should return a non empty string from :#{method}" do
      expect(checker.send(method.to_sym)).not_to be_empty
    end
  end
  context 'ClassMethods' do
    %w(check? available?).each do |method|
      it "should respond to :#{method}" do
        expect(described_class).to respond_to(method.to_sym)
      end
    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
codeqa-0.5.0 spec/support/checker.rb
codeqa-0.4.2 spec/support/checker.rb
codeqa-0.4.1 spec/support/checker.rb
codeqa-0.4.0 spec/support/checker.rb
codeqa-0.4.0.pre2 spec/support/checker.rb
codeqa-0.4.0.pre spec/support/checker.rb
codeqa-0.3.1 spec/support/checker.rb
codeqa-0.3.0 spec/support/checker.rb