source
stringclasses
1 value
repo
stringlengths
5
63
repo_url
stringlengths
24
82
path
stringlengths
5
167
language
stringclasses
1 value
license
stringclasses
5 values
stars
int64
10
51.4k
ref
stringclasses
23 values
size_bytes
int64
200
258k
text
stringlengths
137
258k
github
Kong/docs.konghq.com
https://github.com/Kong/docs.konghq.com
spec/app/_plugins/generators/pages/nav_items_data_spec.rb
Ruby
mit
211
main
1,261
RSpec.describe Jekyll::Pages::NavItemsData do before { generate_site! } describe '#process!' do subject { described_class.new(site: , page:) } context 'when it is not a product page' do let(:page) { find_page_by_url('/search/') } it 'does not modify the page' do expect { subject.proce...
github
Kong/docs.konghq.com
https://github.com/Kong/docs.konghq.com
spec/app/_plugins/generators/docs_single_source/sidenav_spec.rb
Ruby
mit
211
main
1,194
RSpec.describe DocsSingleSource::Sidenav do before { generate_site! } subject { described_class.new(page) } describe '#generate' do context 'when it is the latest page' do let(:page) { find_page_by_url('/gateway/latest/') } it 'generates the sidenav drop' do expect(Jekyll::Drops::Sidena...
github
Kong/docs.konghq.com
https://github.com/Kong/docs.konghq.com
spec/app/_plugins/generators/hooks/products_renderer_spec.rb
Ruby
mit
211
main
4,128
RSpec.describe ProductsRenderer do describe '#render?' do subject { described_class.new } shared_examples_for 'always render home' do it_behaves_like 'renders the page', '/' end shared_examples_for 'renders the page' do |page_dir| it { expect(subject.render?(double(dir: page_dir, relativ...
github
Kong/docs.konghq.com
https://github.com/Kong/docs.konghq.com
spec/app/_plugins/generators/seo/index_entry_builder_spec.rb
Ruby
mit
211
main
2,038
RSpec.describe SEO::IndexEntryBuilder do before { generate_site! } describe '.for' do let(:page) { find_page_by_url(page_url) } subject { described_class.for(page) } context 'plugin page' do let(:page_url) { '/hub/kong-inc/jq/' } it { expect(subject).to be_a(SEO::IndexEntry::HubPage) } ...
github
Kong/docs.konghq.com
https://github.com/Kong/docs.konghq.com
spec/app/_plugins/generators/seo/index_spec.rb
Ruby
mit
211
main
6,124
RSpec.describe SEO::Index do describe '.generate' do before { generate_site! } subject { described_class.generate(site) } it 'generates an index with the latest version of each page' do expect(subject).to eq({ '/hub/' => { 'url' => '/hub/', 'page' => find_page_by_url('/hub/') }, '/...
github
Kong/docs.konghq.com
https://github.com/Kong/docs.konghq.com
spec/app/_plugins/generators/seo/sitemap_spec.rb
Ruby
mit
211
main
4,815
RSpec.describe SEO::Sitemap do describe '.generate' do before do generate_site! index.generate end let(:index) { SEO::Index.new(site) } subject { described_class.generate(index) } it 'sets the corresponding SEO attributes to every page' do index.entries.each do |entry| ...
github
Kong/docs.konghq.com
https://github.com/Kong/docs.konghq.com
spec/app/_plugins/generators/seo/index_entry/global_page_spec.rb
Ruby
mit
211
main
1,192
RSpec.describe SEO::IndexEntry::GlobalPage do let(:page) { find_page_by_url('/gateway/changelog/') } let(:index) { {} } let(:latest) do Utils::Version.to_version(site.data['kong_latest_gateway']['release']) end before do PluginSingleSource::Generator.new.generate(site) Jekyll::Versions.new.genera...
github
Kong/docs.konghq.com
https://github.com/Kong/docs.konghq.com
spec/app/_plugins/generators/seo/index_entry/hub_not_latest_spec.rb
Ruby
mit
211
main
555
RSpec.describe SEO::IndexEntry::HubNotLatest do let(:page) { find_page_by_url('/hub/kong-inc/jq/2.8.x/') } let(:index) { {} } before do PluginSingleSource::Generator.new.generate(site) end subject { described_class.new(page) } describe '#indexable?' do it { expect(subject.indexable?(index)).to eq...
github
Kong/docs.konghq.com
https://github.com/Kong/docs.konghq.com
spec/app/_plugins/generators/seo/index_entry/hub_index_spec.rb
Ruby
mit
211
main
611
RSpec.describe SEO::IndexEntry::HubIndex do let(:page) { find_page_by_url('/hub/') } let(:index) { {} } subject { described_class.new(page) } describe '#indexable?' do it { expect(subject.indexable?(index)).to eq(true) } end describe '#process!' do it 'sets the canonical url to the page' do ...
github
Kong/docs.konghq.com
https://github.com/Kong/docs.konghq.com
spec/app/_plugins/generators/seo/index_entry/unprocessable_page_spec.rb
Ruby
mit
211
main
808
RSpec.describe SEO::IndexEntry::UnprocessablePage, skip: true do let(:page) { find_page_by_url('/deck/pre-1.7/') } let(:index) { {} } before do PluginSingleSource::Generator.new.generate(site) end subject { described_class.new(page) } describe '#indexable?' do it { expect(subject.indexable?(index...
github
Kong/docs.konghq.com
https://github.com/Kong/docs.konghq.com
spec/app/_plugins/generators/seo/index_entry/versioned_page_spec.rb
Ruby
mit
211
main
4,068
RSpec.describe SEO::IndexEntry::VersionedPage do let(:page) { find_page_by_url('/konnect/') } let(:index) { {} } before do Jekyll::GeneratorSingleSource::Generator.new.generate(site) PluginSingleSource::Generator.new.generate(site) Jekyll::Versions.new.generate(site) LatestVersion::Generator.new....
github
Kong/docs.konghq.com
https://github.com/Kong/docs.konghq.com
spec/app/_plugins/generators/seo/index_entry/unversioned_product_page_spec.rb
Ruby
mit
211
main
828
RSpec.describe SEO::IndexEntry::UnversionedProductPage do let(:page) { find_page_by_url('/konnect/') } let(:index) { {} } before do PluginSingleSource::Generator.new.generate(site) end subject { described_class.new(page) } describe '#indexable?' do it { expect(subject.indexable?(index)).to eq(tru...
github
Kong/docs.konghq.com
https://github.com/Kong/docs.konghq.com
spec/app/_plugins/generators/seo/index_entry/hub_latest_spec.rb
Ruby
mit
211
main
560
RSpec.describe SEO::IndexEntry::HubLatest do let(:page) { find_page_by_url('/hub/acme/kong-plugin/') } let(:index) { {} } before do PluginSingleSource::Generator.new.generate(site) end subject { described_class.new(page) } describe '#indexable?' do it { expect(subject.indexable?(index)).to eq(tru...
github
Kong/docs.konghq.com
https://github.com/Kong/docs.konghq.com
spec/app/_plugins/generators/seo/index_entry/hub_html_page_spec.rb
Ruby
mit
211
main
1,004
RSpec.describe SEO::IndexEntry::HubHtmlPage do let(:url) { '/hub/plugins/compatibility/' } let(:page) { double('url' => url, 'data' => {}, 'site' => site) } let(:latest) do Jekyll::GeneratorSingleSource::Product::Edition .new(edition: 'gateway', site:) .latest_release .value end let(:ind...
github
Kong/docs.konghq.com
https://github.com/Kong/docs.konghq.com
spec/app/_plugins/generators/seo/index_entry/unversioned_product_page_spec_deck.rb
Ruby
mit
211
main
816
RSpec.describe SEO::IndexEntry::UnversionedProductPage do let(:page) { find_page_by_url('/deck/') } let(:index) { {} } before do PluginSingleSource::Generator.new.generate(site) end subject { described_class.new(page) } describe '#indexable?' do it { expect(subject.indexable?(index)).to eq(true) ...
github
Kong/docs.konghq.com
https://github.com/Kong/docs.konghq.com
spec/app/_plugins/generators/seo/tags/title_spec.rb
Ruby
mit
211
main
3,281
RSpec.describe SEO::Tags::Title do before { generate_site! } describe '#process' do subject! { described_class.new(page).process } context 'home' do let(:page) { find_page_by_url('/') } it { expect(page.data['title_tag']).to eq('Kong Docs') } end context 'hub pages' do context...
github
Kong/docs.konghq.com
https://github.com/Kong/docs.konghq.com
spec/app/_plugins/generators/plugin_single_source/single_source_page_spec.rb
Ruby
mit
211
main
5,016
RSpec.describe PluginSingleSource::SingleSourcePage do describe '#initialize' do let(:plugin) do PluginSingleSource::Plugin::Base.make_for(dir: 'kong-inc/jwt-signer', site:) end let(:release) do PluginSingleSource::Plugin::Release.new(site:, version:, plugin:, is_latest:) end let(:page...
github
Kong/docs.konghq.com
https://github.com/Kong/docs.konghq.com
spec/app/_plugins/generators/plugin_single_source/pages/base_spec.rb
Ruby
mit
211
main
2,972
RSpec.describe PluginSingleSource::Pages::Base do let(:file) { 'overview/_index.md' } let(:plugin) { PluginSingleSource::Plugin::Base.make_for(dir: 'kong-inc/jwt-signer', site:) } let(:release) { PluginSingleSource::Plugin::Release.new(site:, version:, plugin:, is_latest: true) } let(:source_path) { File.expand...
github
Kong/docs.konghq.com
https://github.com/Kong/docs.konghq.com
spec/app/_plugins/generators/plugin_single_source/pages/overview_spec.rb
Ruby
mit
211
main
4,978
RSpec.describe PluginSingleSource::Pages::Overview do let(:file) { 'overview/_index.md' } let(:plugin) { PluginSingleSource::Plugin::Base.make_for(dir: 'kong-inc/jwt-signer', site:) } let(:release) { PluginSingleSource::Plugin::Release.new(site:, version:, plugin:, is_latest:) } subject { described_class.new(r...
github
Kong/docs.konghq.com
https://github.com/Kong/docs.konghq.com
spec/app/_plugins/generators/plugin_single_source/pages/configuration_examples_spec.rb
Ruby
mit
211
main
2,399
RSpec.describe PluginSingleSource::Pages::ConfigurationExamples do let(:plugin_name) { 'kong-inc/jwt-signer' } let(:plugin) { PluginSingleSource::Plugin::Base.make_for(dir: plugin_name, site:) } let(:release) { PluginSingleSource::Plugin::Release.new(site:, version:, plugin:, is_latest:) } let(:file) { "_src/.r...
github
Kong/docs.konghq.com
https://github.com/Kong/docs.konghq.com
spec/app/_plugins/generators/plugin_single_source/pages/configuration_spec.rb
Ruby
mit
211
main
3,834
RSpec.describe PluginSingleSource::Pages::Configuration do let(:plugin_name) { 'kong-inc/jwt-signer' } let(:plugin) { PluginSingleSource::Plugin::Base.make_for(dir: plugin_name, site:) } let(:release) { PluginSingleSource::Plugin::Release.new(site:, version:, plugin:, is_latest:) } let(:file) { "_src/.repos/kon...
github
Kong/docs.konghq.com
https://github.com/Kong/docs.konghq.com
spec/app/_plugins/generators/plugin_single_source/pages/changelog_spec.rb
Ruby
mit
211
main
2,728
RSpec.describe PluginSingleSource::Pages::Changelog do let(:file) { '_changelog.md' } let(:plugin) { PluginSingleSource::Plugin::Base.make_for(dir: 'kong-inc/jwt-signer', site:) } let(:release) { PluginSingleSource::Plugin::Release.new(site:, version:, plugin:, is_latest:) } let(:source_path) { File.expand_path...
github
Kong/docs.konghq.com
https://github.com/Kong/docs.konghq.com
spec/app/_plugins/generators/plugin_single_source/pages/how_to_spec.rb
Ruby
mit
211
main
3,787
RSpec.describe PluginSingleSource::Pages::HowTo do let(:plugin) { PluginSingleSource::Plugin::Base.make_for(dir: 'kong-inc/jwt-signer', site:) } let(:release) { PluginSingleSource::Plugin::Release.new(site:, version:, plugin:, is_latest:) } subject { described_class.new(release:, file:, source_path:) } descri...
github
Kong/docs.konghq.com
https://github.com/Kong/docs.konghq.com
spec/app/_plugins/generators/plugin_single_source/plugin/release_spec.rb
Ruby
mit
211
main
4,415
RSpec.describe PluginSingleSource::Plugin::Release do let(:plugin_name) { 'kong-inc/jwt-signer' } let(:is_latest) { true } let(:version) { '2.8.x' } let(:plugin) do PluginSingleSource::Plugin::Base.make_for(dir: plugin_name, site:) end subject { described_class.new(site:, version:, plugin:, is_latest:)...
github
Kong/docs.konghq.com
https://github.com/Kong/docs.konghq.com
spec/app/_plugins/generators/plugin_single_source/plugin/page_data_spec.rb
Ruby
mit
211
main
4,058
RSpec.describe PluginSingleSource::Plugin::PageData do let(:plugin_name) { 'kong-inc/jwt-signer' } let(:plugin) do PluginSingleSource::Plugin::Base.make_for(dir: plugin_name, site:) end let(:release) do PluginSingleSource::Plugin::Release.new(site:, version:, plugin:, is_latest:) end subject { desc...
github
Kong/docs.konghq.com
https://github.com/Kong/docs.konghq.com
spec/app/_plugins/generators/plugin_single_source/plugin/unversioned_spec.rb
Ruby
mit
211
main
828
RSpec.describe PluginSingleSource::Plugin::Unversioned do let(:dir) { [author, name].join('/') } let(:name) { 'kong-plugin' } let(:author) { 'acme' } subject { described_class.new(dir:, site:) } it_behaves_like 'a Plugin' describe '#extension?' do it { expect(subject.extension?).to eq(false) } end ...
github
Kong/docs.konghq.com
https://github.com/Kong/docs.konghq.com
spec/app/_plugins/generators/plugin_single_source/plugin/base_spec.rb
Ruby
mit
211
main
513
RSpec.describe PluginSingleSource::Plugin::Base do describe '.make_for' do subject { described_class.make_for(dir:, site:) } context 'a plugin with a `versions.yml`' do let(:dir) { 'kong-inc/jq' } it { expect(subject).to be_an_instance_of(PluginSingleSource::Plugin::Versioned) } end con...
github
Kong/docs.konghq.com
https://github.com/Kong/docs.konghq.com
spec/app/_plugins/generators/plugin_single_source/plugin/versioned_spec.rb
Ruby
mit
211
main
3,110
RSpec.describe PluginSingleSource::Plugin::Versioned do let(:dir) { [author, name].join('/') } let(:name) { 'jq' } let(:author) { 'kong-inc' } subject { described_class.new(dir:, site:) } it_behaves_like 'a Plugin' describe '#extension?' do it { expect(subject.extension?).to eq(true) } end descr...
github
Kong/docs.konghq.com
https://github.com/Kong/docs.konghq.com
spec/app/_plugins/generators/plugin_single_source/plugin/releases_generator_spec.rb
Ruby
mit
211
main
468
RSpec.describe PluginSingleSource::Plugin::ReleasesGenerator do describe '.call' do let(:releases) { ['2.4.x', '2.2.x', '2.3.x'] } let(:replacements) { { '2.3.x' => ['2.3.x-CE', '2.3.x-EE'], '2.1.x': ['2.1.x-CE'] } } subject { described_class.call(releases:, replacements:) } it 'overrides the releas...
github
Kong/docs.konghq.com
https://github.com/Kong/docs.konghq.com
spec/app/_plugins/generators/plugin_single_source/plugin/examples/base_spec.rb
Ruby
mit
211
main
910
RSpec.describe PluginSingleSource::Plugin::Examples::Base do let(:version) { '3.1.1' } subject { described_class.make_for(name:, vendor:, version:) } describe '.make_for' do context 'when the vendor is kong-inc' do let(:vendor) { 'kong-inc' } let(:name) { 'acme' } it { expect(subject).to ...
github
Kong/docs.konghq.com
https://github.com/Kong/docs.konghq.com
spec/app/_plugins/generators/plugin_single_source/plugin/examples/kong_spec.rb
Ruby
mit
211
main
411
RSpec.describe PluginSingleSource::Plugin::Examples::Kong do let(:name) { 'acme' } let(:vendor) { 'kong-inc' } let(:version) { '3.1.1' } describe '#file_path' do subject { described_class.new(name:, vendor:, version:) } it 'returns the path to the corresponding example file' do expect(subject.fi...
github
Kong/docs.konghq.com
https://github.com/Kong/docs.konghq.com
spec/app/_plugins/generators/plugin_single_source/plugin/examples/third_party_spec.rb
Ruby
mit
211
main
368
RSpec.describe PluginSingleSource::Plugin::Examples::ThirdParty do describe '#file_path' do subject { described_class.new(name: 'kong-plugin', vendor: 'acme', version: '3.1.1') } it 'returns the path to the corresponding example file' do expect(subject.file_path).to eq('spec/fixtures/app/_hub/acme/kong...
github
Kong/docs.konghq.com
https://github.com/Kong/docs.konghq.com
spec/app/_plugins/generators/plugin_single_source/plugin/schemas/kong_spec.rb
Ruby
mit
211
main
3,810
RSpec.describe PluginSingleSource::Plugin::Schemas::Kong do let(:plugin_name) { 'acme'} let(:vendor) { 'kong-inc' } let(:acme_schema) { JSON.parse(File.read('app/_src/.repos/kong-plugins/schemas/acme/3.1.x.json')) } let(:version) { '3.1.1' } subject { described_class.new(plugin_name:, vendor:, version:, site...
github
Kong/docs.konghq.com
https://github.com/Kong/docs.konghq.com
spec/app/_plugins/generators/plugin_single_source/plugin/schemas/third_party_spec.rb
Ruby
mit
211
main
1,816
RSpec.describe PluginSingleSource::Plugin::Schemas::ThirdParty do let(:plugin_name) { 'kong-plugin'} let(:vendor) { 'acme' } let(:schema) { JSON.parse(File.read('spec/fixtures/app/_hub/acme/kong-plugin/schemas/_index.json')) } let(:version) { '3.1.1' } subject { described_class.new(plugin_name:, vendor:, ver...
github
Kong/docs.konghq.com
https://github.com/Kong/docs.konghq.com
spec/app/_plugins/blocks/plugin_example_spec.rb
Ruby
mit
211
main
1,769
RSpec.describe Jekyll::PluginExample do before { generate_site! } let(:page) { find_page_by_url('/gateway/latest/') } let(:environment) { { 'page' => page } } let(:liquid_context) { Liquid::Context.new(environment, {}, site: site, page: page.data) } let(:liquid_block) do <<~BLOCK {% plugin_example %} tit...
github
Kong/docs.konghq.com
https://github.com/Kong/docs.konghq.com
spec/app/_plugins/blocks/inline_plugin_example/config_spec.rb
Ruby
mit
211
main
2,978
RSpec.describe Jekyll::InlinePluginExample::Config do let(:page) { { 'release' => double('value' => '3.2.x') } } let(:plugin_config) do SafeYAML.load( <<~CONFIG title: Opinionated Example plugin: kong-inc/jwt-signer name: jwt-signer config: access_token_introspect...
github
Kong/docs.konghq.com
https://github.com/Kong/docs.konghq.com
spec/app/_plugins/drops/releases_dropdown_spec.rb
Ruby
mit
211
main
455
RSpec.describe Jekyll::Drops::ReleasesDropdown do before { generate_site! } let(:page) { find_page_by_url('/gateway/latest/') } subject { described_class.new(page) } describe '#current' do it 'returns the page\'s release' do expect(subject.current).to eq('3.0.x') end end describe '#options...
github
Kong/docs.konghq.com
https://github.com/Kong/docs.konghq.com
spec/app/_plugins/drops/option_spec.rb
Ruby
mit
211
main
2,764
RSpec.describe Jekyll::Drops::Option do let(:page) { find_page_by_url('/gateway/latest/') } let(:release) { page.data['release'] } before { generate_site! } subject { described_class.new(page:, release:) } describe '#value' do context 'when it is the latest page' do it { expect(subject.value).to ...
github
Kong/docs.konghq.com
https://github.com/Kong/docs.konghq.com
spec/app/_plugins/drops/plugins/schema_spec.rb
Ruby
mit
211
main
2,805
RSpec.describe Jekyll::Drops::Plugins::Schema do let(:plugin_name) { 'application-registration' } let(:metadata_file) { 'app/_hub/kong-inc/application-registration/_metadata/_index.yml' } let(:metadata) { SafeYAML.load(File.read(metadata_file)) } let(:version) { '3.1.1' } let(:schema) do PluginSingleSourc...
github
Kong/docs.konghq.com
https://github.com/Kong/docs.konghq.com
spec/app/_plugins/drops/plugins/badges_spec.rb
Ruby
mit
211
main
1,521
RSpec.describe Jekyll::Drops::Plugins::Badges do let(:publisher) { 'kong-inc' } let(:free) { false } let(:konnect) { true } let(:enterprise) { true } let(:metadata) do { 'free' => free, 'konnect' => konnect, 'enterprise' => enterprise } end subject { described_class.new(metadat...
github
Kong/docs.konghq.com
https://github.com/Kong/docs.konghq.com
spec/app/_plugins/drops/plugins/versions_dropdown_option_spec.rb
Ruby
mit
211
main
3,331
RSpec.describe Jekyll::Drops::Plugins::VersionsDropdownOption do subject { described_class.new(page:, release:, latest:, current:) } let(:site) { double(data: { 'pages_urls' => Set.new(urls) }) } let(:urls) { [] } let(:page) do double(dropdown_url: '/hub/kong-inc/jwt-signer/VERSION/', site:, base_url: '/hu...
github
Kong/docs.konghq.com
https://github.com/Kong/docs.konghq.com
spec/app/_plugins/drops/plugins/hub_examples_spec.rb
Ruby
mit
211
main
5,516
RSpec.describe Jekyll::Drops::Plugins::HubExamples do let(:version) { '3.2.2' } let(:plugin_name) { 'opentelemetry' } let(:schema) do PluginSingleSource::Plugin::Schemas::Kong.new( plugin_name:, vendor: 'kong-inc', version: version, site: ) end let(:example) { schema.example } ...
github
Kong/docs.konghq.com
https://github.com/Kong/docs.konghq.com
spec/app/_plugins/drops/plugins/example_spec.rb
Ruby
mit
211
main
3,109
RSpec.describe Jekyll::Drops::Plugins::Example do let(:type) { 'consumer' } let(:schema) do PluginSingleSource::Plugin::Schemas::Base.make_for( name: 'opentelemetry', vendor: 'kong-inc', version: '3.2.x', site: ) end let(:example) { schema.example } let(:formats) { [:curl, :kon...
github
Kong/docs.konghq.com
https://github.com/Kong/docs.konghq.com
spec/app/_plugins/drops/plugins/schema_field_spec.rb
Ruby
mit
211
main
4,152
RSpec.describe Jekyll::Drops::Plugins::SchemaField do let(:name) { 'config' } let(:parent) { '' } let(:field_schema) { schema.config } let(:plugin_name) { 'saml' } let(:version) { '3.2.2' } let(:schema) do PluginSingleSource::Plugin::Schemas::Kong.new( plugin_name: plugin_name, vendor: 'kong...
github
Kong/docs.konghq.com
https://github.com/Kong/docs.konghq.com
spec/app/_plugins/drops/plugins/sidenav_menu_item_spec.rb
Ruby
mit
211
main
1,395
RSpec.describe Jekyll::Drops::SidenavMenuItem do let(:options) do { 'docs_url' => 'gateway', 'version' => '3.2.x' } end subject { described_class.new(item:, options:)} describe '#url' do context 'when the url is absolute' do let(:item) do { 'text' => 'Portal API...
github
Kong/docs.konghq.com
https://github.com/Kong/docs.konghq.com
spec/app/_plugins/drops/plugins/examples/curl_spec.rb
Ruby
mit
211
main
1,161
RSpec.describe Jekyll::Drops::Plugins::Examples::Curl do let(:type) {} let(:example) do SafeYAML.load( File.read('app/_src/.repos/kong-plugins/examples/acme/_3.2.x.yaml') ) end subject { described_class.new(type:, example:) } describe '#params' do it 'returns the list of params defined on ...
github
Kong/docs.konghq.com
https://github.com/Kong/docs.konghq.com
spec/app/_plugins/drops/plugins/examples/yaml_spec.rb
Ruby
mit
211
main
1,321
RSpec.describe Jekyll::Drops::Plugins::Examples::Yaml do let(:example) do SafeYAML.load( File.read('app/_src/.repos/kong-plugins/examples/opentelemetry/_3.2.x.yaml') ) end subject { described_class.new(type:, example:) } describe '#example_config' do let(:type) { 'consumer' } it 'return...
github
Kong/docs.konghq.com
https://github.com/Kong/docs.konghq.com
spec/app/_plugins/tags/referenceable_fields_spec/table_tag_spec.rb
Ruby
mit
211
main
2,777
require 'ostruct' RSpec.describe Jekyll::ReferenceableFieldsTable do let(:version) { '3.2.x' } let(:hub) do [ instance_double('PluginSingleSource::SingleSourcePage', data: { 'extn_slug' => 'aws-lambda', 'name' => 'AWS Lambda' } ), instance_double('PluginSingleSource::SingleSourcePage', data: { 'ext...
github
Kong/docs.konghq.com
https://github.com/Kong/docs.konghq.com
spec/templates/plugin_with_versions_spec.rb
Ruby
mit
211
main
2,378
RSpec.describe 'Plugin page with multiple versions' do let(:page) { find_page_by_url(page_url) } let(:html) { Capybara::Node::Simple.new(page.output) } before do generate_site! render_page(page: page) end context 'versions with a specific file - _2.6.x' do let(:page_url) { '/hub/kong-inc/jwt-sig...
github
Kong/docs.konghq.com
https://github.com/Kong/docs.konghq.com
spec/templates/plugin_spec.rb
Ruby
mit
211
main
642
RSpec.describe 'Plugin page' do let(:page) { find_page_by_url('/hub/acme/unbundled-plugin/') } let(:html) { Capybara::Node::Simple.new(page.output) } before do generate_site! render_page(page: page) end it 'renders metadata in the header' do expect(html).to have_css('.page-header--info-icon') ...
github
Kong/docs.konghq.com
https://github.com/Kong/docs.konghq.com
spec/templates/plugins/configuration_spec.rb
Ruby
mit
211
main
10,814
RSpec.describe 'Plugin page' do let(:page) { find_page_by_url('/hub/acme/unbundled-plugin/configuration/') } let(:html) { Capybara::Node::Simple.new(page.output) } before do generate_site! render_page(page: page) end it 'renders the corresponding sidenav' do sidebar = html.find('.docs-sidebar') ...
github
socketry/covered
https://github.com/socketry/covered
bake.rb
Ruby
mit
211
main
359
# frozen_string_literal: true # Released under the MIT License. # Copyright, 2025, by Samuel Williams. # Update the project documentation with the new version number. # # @parameter version [String] The new version number. def after_gem_release_version_increment(version) context["releases:update"].call(version) con...
github
socketry/covered
https://github.com/socketry/covered
covered.gemspec
Ruby
mit
211
main
990
# frozen_string_literal: true require_relative "lib/covered/version" Gem::Specification.new do |spec| spec.name = "covered" spec.version = Covered::VERSION spec.summary = "A modern approach to code coverage." spec.authors = ["Samuel Williams", "Adam Daniels", "Aron Latis", "Cyril Roelandt", "Felix Yan", "Michae...
github
socketry/covered
https://github.com/socketry/covered
gems.rb
Ruby
mit
211
main
457
# frozen_string_literal: true # Released under the MIT License. # Copyright, 2018-2025, by Samuel Williams. source "https://rubygems.org" gemspec group :maintenance do gem "bake-modernize" gem "bake-gem" gem "bake-releases" gem "agent-context" gem "utopia-project" end group :test do gem "sus" gem "decod...
github
socketry/covered
https://github.com/socketry/covered
test/covered/partial_summary.rb
Ruby
mit
211
main
2,054
# frozen_string_literal: true # Released under the MIT License. # Copyright, 2018-2025, by Samuel Williams. require "covered/partial_summary" require "covered/files" describe Covered::PartialSummary do let(:files) {Covered::Files.new} let(:summary) {subject.new} let(:first_line) {File.readlines(__FILE__).first}...
github
socketry/covered
https://github.com/socketry/covered
test/covered/rspec.rb
Ruby
mit
211
main
534
# frozen_string_literal: true # Released under the MIT License. # Copyright, 2022-2025, by Samuel Williams. require "covered" require "rspec_tests" describe "Covered::RSpec" do include RSpecTests it "can run rspec test suite with coverage" do input, output = IO.pipe system({"COVERAGE" => "PartialSummary"}...
github
socketry/covered
https://github.com/socketry/covered
test/covered/statistics.rb
Ruby
mit
211
main
1,336
# frozen_string_literal: true # Released under the MIT License. # Copyright, 2018-2025, by Samuel Williams. require "covered/statistics" describe Covered::Statistics do let(:statistics) {subject.new} let(:source) {Covered::Source.new("foo.rb")} with "initial state" do it "is zero" do expect(statistics.coun...
github
socketry/covered
https://github.com/socketry/covered
test/covered/minitest.rb
Ruby
mit
211
main
506
# frozen_string_literal: true # Released under the MIT License. # Copyright, 2022-2025, by Samuel Williams. require "covered" require "minitest_tests" describe "Covered::Minitest" do include MinitestTests it "can run minitest test suite with coverage" do input, output = IO.pipe system({"COVERAGE" => "Part...
github
socketry/covered
https://github.com/socketry/covered
test/covered/files.rb
Ruby
mit
211
main
2,388
# frozen_string_literal: true # Released under the MIT License. # Copyright, 2018-2025, by Samuel Williams. require "covered/files" describe Covered::Files do let(:files) {subject.new} with "#mark" do it "can mark lines" do files.mark("program.rb", 2, 1) expect(files.paths["program.rb"][2]).to be == ...
github
socketry/covered
https://github.com/socketry/covered
test/covered/summary.rb
Ruby
mit
211
main
560
# frozen_string_literal: true # Released under the MIT License. # Copyright, 2018-2025, by Samuel Williams. require "covered/summary" require "covered/files" describe Covered::Summary do let(:files) {Covered::Files.new} let(:summary) {Covered::Summary.new} let(:first_line) {File.readlines(__FILE__).first} let(...
github
socketry/covered
https://github.com/socketry/covered
test/covered/policy.rb
Ruby
mit
211
main
1,499
# frozen_string_literal: true # Released under the MIT License. # Copyright, 2018-2025, by Samuel Williams. require "covered/policy" describe Covered::Policy do let(:pattern) {"**/*.rb"} let(:policy) {subject.new} it "can start capture via policy" do expect do policy.start policy.finish end.not.to rai...
github
socketry/covered
https://github.com/socketry/covered
test/covered/wrapper.rb
Ruby
mit
211
main
204
# frozen_string_literal: true # Released under the MIT License. # Copyright, 2018-2025, by Samuel Williams. require "wrapper_examples" describe Covered::Wrapper do it_behaves_like WrapperExamples end
github
socketry/covered
https://github.com/socketry/covered
test/covered/forks.rb
Ruby
mit
211
main
1,346
# frozen_string_literal: true # Released under the MIT License. # Copyright, 2023-2025, by Samuel Williams. require "covered/config" require "tmpdir" describe Covered::Forks do def measure_coverage(code) Dir.mktmpdir do |root| config = Covered::Config.load(root: root) test_path = config.policy.expand_path("...
github
socketry/covered
https://github.com/socketry/covered
test/covered/brief_summary.rb
Ruby
mit
211
main
575
# frozen_string_literal: true # Released under the MIT License. # Copyright, 2018-2025, by Samuel Williams. require "covered/brief_summary" require "covered/files" describe Covered::BriefSummary do let(:files) {Covered::Files.new} let(:summary) {subject.new} let(:first_line) {File.readlines(__FILE__).first} le...
github
socketry/covered
https://github.com/socketry/covered
test/covered/persist.rb
Ruby
mit
211
main
505
# frozen_string_literal: true # Released under the MIT License. # Copyright, 2019-2025, by Samuel Williams. require "covered/coverage" require "covered/persist" require "wrapper_examples" describe Covered::Persist do it_behaves_like WrapperExamples let(:coverage) {Covered::Coverage.for(__FILE__)} let(:output) {...
github
socketry/covered
https://github.com/socketry/covered
test/covered/policy/autoload.rb
Ruby
mit
211
main
569
# frozen_string_literal: true # Released under the MIT License. # Copyright, 2019-2025, by Samuel Williams. require "covered/policy" describe Covered::Policy::Autoload do with "PartialSummary class" do let(:autoload) {subject.new("PartialSummary")} it "should autoload and instantiate class" do expect(auto...
github
socketry/covered
https://github.com/socketry/covered
test/covered/source/xrb.rb
Ruby
mit
211
main
939
# frozen_string_literal: true # Released under the MIT License. # Copyright, 2018-2025, by Samuel Williams. require "covered/files" require "covered/summary" require "covered/capture" require "xrb/template" let(:template_path) {File.expand_path("template.xrb", __dir__)} let(:template) {XRB::Template.load_file(templ...
github
socketry/covered
https://github.com/socketry/covered
test/covered/source/erb.rb
Ruby
mit
211
main
787
# frozen_string_literal: true # Released under the MIT License. # Copyright, 2022-2025, by Samuel Williams. require "erb" require "covered/files" require "covered/capture" require "covered/summary" let(:code) {<<~ERB} <ul> <% items.each do |item| %> <li> The item: <%= item %> </li> <% end %> </ul> ERB it ...
github
socketry/covered
https://github.com/socketry/covered
test/covered/source/rescue.rb
Ruby
mit
211
main
691
# frozen_string_literal: true # Released under the MIT License. # Copyright, 2022-2025, by Samuel Williams. require "covered/files" require "covered/capture" require "covered/summary" let(:code) {<<~RUBY} begin raise "Hello" rescue ArgumentError => error rescue RuntimeError => error x = 20 y = 30 end RUBY it "ca...
github
socketry/covered
https://github.com/socketry/covered
test/covered/source/multiline.rb
Ruby
mit
211
main
526
# frozen_string_literal: true # Released under the MIT License. # Copyright, 2022-2025, by Samuel Williams. require "covered/files" require "covered/capture" let(:code) {<<~RUBY} output = String.new begin output << " ".freeze; end RUBY it "can parse multi-line methods" do files = Covered::Files.new source = Co...
github
socketry/covered
https://github.com/socketry/covered
bake/covered/debug.rb
Ruby
mit
211
main
733
# frozen_string_literal: true # Released under the MIT License. # Copyright, 2022-2025, by Samuel Williams. def initialize(context) super require_relative "../../lib/covered" end # Debug the coverage of a file. Show which lines should be executable. # # @parameter paths [Array(String)] The paths to parse. # @par...
github
socketry/covered
https://github.com/socketry/covered
bake/covered/validate.rb
Ruby
mit
211
main
864
# frozen_string_literal: true # Released under the MIT License. # Copyright, 2022-2025, by Samuel Williams. def initialize(context) super require_relative "../../lib/covered/config" end # Validate the coverage of multiple test runs. # @parameter paths [Array(String)] The coverage database paths. # @parameter min...
github
socketry/covered
https://github.com/socketry/covered
bake/covered/policy.rb
Ruby
mit
211
main
1,564
# frozen_string_literal: true # Released under the MIT License. # Copyright, 2023-2025, by Samuel Williams. # Copyright, 2023, by Michael Adams. def initialize(context) super require_relative "../../lib/covered/config" end # Load the current coverage policy. # Defaults to the default coverage path if no paths ar...
github
socketry/covered
https://github.com/socketry/covered
examples/begin.rb
Ruby
mit
211
main
221
# frozen_string_literal: true # Released under the MIT License. # Copyright, 2022-2023, by Samuel Williams. # COVERAGE=PartialSummary bundle exec ruby "-rcovered/autostart" begin.rb begin x = [1] [2] [3] rescue end
github
socketry/covered
https://github.com/socketry/covered
examples/struct/coverage.rb
Ruby
mit
211
main
211
#!/usr/bin/env ruby # frozen_string_literal: true # Released under the MIT License. # Copyright, 2022-2025, by Samuel Williams. require "coverage" Coverage.start require_relative "struct" p Coverage.result
github
socketry/covered
https://github.com/socketry/covered
examples/struct/iseq.rb
Ruby
mit
211
main
247
#!/usr/bin/env ruby # frozen_string_literal: true # Released under the MIT License. # Copyright, 2022, by Samuel Williams. path = File.expand_path("struct.rb", __dir__) iseq = RubyVM::InstructionSequence.compile_file(path) puts iseq.disassemble
github
socketry/covered
https://github.com/socketry/covered
examples/struct/struct.rb
Ruby
mit
211
main
227
#!/usr/bin/env ruby # frozen_string_literal: true # Released under the MIT License. # Copyright, 2022, by Samuel Williams. Thing = Struct.new(:name, :shape) thing = Thing.new(:cat, :rectangle) [ thing.name, thing.shape, ]
github
socketry/covered
https://github.com/socketry/covered
examples/erb/test.rb
Ruby
mit
211
main
465
#!/usr/bin/env ruby # frozen_string_literal: true # Released under the MIT License. # Copyright, 2023-2025, by Samuel Williams. require "coverage" require "erb" Coverage.start(lines: true, eval: true) def test(value = nil, default: "World", path: "template.erb") template = ERB.new(File.read(path)) template.locati...
github
socketry/covered
https://github.com/socketry/covered
lib/covered.rb
Ruby
mit
211
main
264
# frozen_string_literal: true # Released under the MIT License. # Copyright, 2018-2025, by Samuel Williams. require_relative "covered/version" require_relative "covered/policy" require_relative "covered/brief_summary" require_relative "covered/partial_summary"
github
socketry/covered
https://github.com/socketry/covered
lib/covered/partial_summary.rb
Ruby
mit
211
main
2,220
# frozen_string_literal: true # Released under the MIT License. # Copyright, 2025, by Samuel Williams. require_relative "summary" module Covered class PartialSummary < Summary def print_coverage(terminal, coverage, before: 4, after: 4) return if coverage.zero? line_offset = 1 counts = coverage.counts...
github
socketry/covered
https://github.com/socketry/covered
lib/covered/summary.rb
Ruby
mit
211
main
3,708
# frozen_string_literal: true # Released under the MIT License. # Copyright, 2018-2025, by Samuel Williams. require_relative "statistics" require_relative "wrapper" module Covered class Summary def initialize(threshold: 1.0) @threshold = threshold end def terminal(output) require "console/terminal" ...
github
socketry/covered
https://github.com/socketry/covered
lib/covered/source.rb
Ruby
mit
211
main
1,414
# frozen_string_literal: true # Released under the MIT License. # Copyright, 2018-2023, by Samuel Williams. module Covered class Source def self.for(path, **options) if File.exist?(path) # options[:code] ||= File.read(path) options[:modified_time] ||= File.mtime(path) end self.new(path, **opti...
github
socketry/covered
https://github.com/socketry/covered
lib/covered/minitest.rb
Ruby
mit
211
main
468
# frozen_string_literal: true # Released under the MIT License. # Copyright, 2019-2025, by Samuel Williams. # Copyright, 2022, by Adam Daniels. require_relative "config" require "minitest" $covered = Covered::Config.load module Covered module Minitest def run(*) $covered.start super end end end if...
github
socketry/covered
https://github.com/socketry/covered
lib/covered/sus.rb
Ruby
mit
211
main
701
# frozen_string_literal: true # Released under the MIT License. # Copyright, 2019-2025, by Samuel Williams. module Covered module Sus def initialize(...) super # Defer loading the coverage configuration unless we are actually running with coverage startd to avoid performance cost/overhead. if ENV["COV...
github
socketry/covered
https://github.com/socketry/covered
lib/covered/wrapper.rb
Ruby
mit
211
main
1,836
# frozen_string_literal: true # Released under the MIT License. # Copyright, 2018-2023, by Samuel Williams. module Covered class Base # Start tracking coverage. def start end # Discard any coverage data and restart tracking. def clear end # Stop tracking coverage. def finish end def acce...
github
socketry/covered
https://github.com/socketry/covered
lib/covered/persist.rb
Ruby
mit
211
main
2,468
# frozen_string_literal: true # Released under the MIT License. # Copyright, 2019-2025, by Samuel Williams. # Copyright, 2023, by Stephen Ierodiaconou. require_relative "wrapper" require "msgpack" require "time" module Covered class Persist < Wrapper DEFAULT_PATH = ".covered.db" def initialize(output, path ...
github
socketry/covered
https://github.com/socketry/covered
lib/covered/coverage.rb
Ruby
mit
211
main
4,091
# frozen_string_literal: true # Released under the MIT License. # Copyright, 2018-2025, by Samuel Williams. require_relative "source" module Covered module Ratio def ratio return 1.0 if executable_count.zero? Rational(executed_count, executable_count) end def complete? executed_count == execut...
github
socketry/covered
https://github.com/socketry/covered
lib/covered/capture.rb
Ruby
mit
211
main
1,074
# frozen_string_literal: true # Released under the MIT License. # Copyright, 2018-2025, by Samuel Williams. require_relative "wrapper" require "coverage" module Covered class Capture < Wrapper def start super ::Coverage.start(lines: true, eval: true) end def clear super ::Coverage.resu...
github
socketry/covered
https://github.com/socketry/covered
lib/covered/brief_summary.rb
Ruby
mit
211
main
806
# frozen_string_literal: true # Released under the MIT License. # Copyright, 2025, by Samuel Williams. require_relative "summary" module Covered class BriefSummary < Summary def call(wrapper, output = $stdout, before: 4, after: 4) terminal = self.terminal(output) ordered = [] statistics = self.ea...
github
socketry/covered
https://github.com/socketry/covered
lib/covered/rspec.rb
Ruby
mit
211
main
632
# frozen_string_literal: true # Released under the MIT License. # Copyright, 2018-2025, by Samuel Williams. require_relative "config" require "rspec/core/formatters" $covered = Covered::Config.load module Covered module RSpec module Policy def load_spec_files $covered.start super end de...
github
socketry/covered
https://github.com/socketry/covered
lib/covered/policy.rb
Ruby
mit
211
main
2,152
# frozen_string_literal: true # Released under the MIT License. # Copyright, 2018-2025, by Samuel Williams. require_relative "summary" require_relative "files" require_relative "capture" require_relative "persist" require_relative "forks" module Covered class Policy < Wrapper def initialize super(Files.new) ...
github
socketry/covered
https://github.com/socketry/covered
lib/covered/forks.rb
Ruby
mit
211
main
1,205
# frozen_string_literal: true # Released under the MIT License. # Copyright, 2023-2025, by Samuel Williams. require_relative "wrapper" module Covered class Forks < Wrapper def start super Handler.start(self) end def finish Handler.finish super end module Handler LOCK = Mutex.n...
github
socketry/covered
https://github.com/socketry/covered
lib/covered/autostart.rb
Ruby
mit
211
main
591
# frozen_string_literal: true # Released under the MIT License. # Copyright, 2023-2025, by Samuel Williams. require_relative "config" module Coverage module Autostart # Start recording coverage information. # Usage: RUBYOPT=-rcovered/autostart ruby my_script.rb def self.autostart! config = Covered::Config....
github
socketry/covered
https://github.com/socketry/covered
lib/covered/markdown_summary.rb
Ruby
mit
211
main
2,020
# frozen_string_literal: true # Released under the MIT License. # Copyright, 2021-2025, by Samuel Williams. require_relative "statistics" require_relative "wrapper" require "console/output" module Covered class MarkdownSummary def initialize(threshold: 1.0) @threshold = threshold end def each(wrapper) ...
github
socketry/covered
https://github.com/socketry/covered
lib/covered/files.rb
Ruby
mit
211
main
2,367
# frozen_string_literal: true # Released under the MIT License. # Copyright, 2018-2025, by Samuel Williams. require_relative "coverage" require_relative "wrapper" require "set" module Covered class Files < Base def initialize(*) super @paths = {} end attr_accessor :paths def [](path) @pa...
github
socketry/covered
https://github.com/socketry/covered
lib/covered/config.rb
Ruby
mit
211
main
3,070
# frozen_string_literal: true # Released under the MIT License. # Copyright, 2019-2025, by Samuel Williams. require_relative "policy" module Covered class Config PATH = "config/covered.rb" def self.root ENV["COVERED_ROOT"] || Dir.pwd end def self.path(root) path = ::File.expand_path(PATH, root) ...
github
socketry/covered
https://github.com/socketry/covered
lib/covered/statistics.rb
Ruby
mit
211
main
3,130
# frozen_string_literal: true # Released under the MIT License. # Copyright, 2018-2025, by Samuel Williams. require_relative "wrapper" require_relative "coverage" module Covered class CoverageError < StandardError end class Statistics include Ratio def self.for(coverage) self.new.tap do |statistics| ...
github
algolia/jekyll-algolia
https://github.com/algolia/jekyll-algolia
jekyll-algolia.gemspec
Ruby
mit
211
main
1,838
# frozen_string_literal: true require File.join(__dir__, 'lib/jekyll/algolia/version.rb') Gem::Specification.new do |gem| # Required attributes gem.name = 'jekyll-algolia' gem.summary = 'Index your Jekyll content into Algolia' gem.version = Jekyll::Algolia::VERSION # Recommended attributes gem.authors = ...
github
algolia/jekyll-algolia
https://github.com/algolia/jekyll-algolia
Rakefile
Ruby
mit
211
main
5,526
# frozen_string_literal: true require 'rubygems' require 'bundler' begin Bundler.setup(:default, :development) rescue Bundler::BundlerError => e warn e.message warn 'Run `bundle install` to install missing gems' exit e.status_code end require 'algoliasearch' require 'rake' require 'rspec/core' require 'rspec/c...
github
algolia/jekyll-algolia
https://github.com/algolia/jekyll-algolia
Guardfile
Ruby
mit
211
main
409
# frozen_string_literal: true # Live-reload unit tests guard :rspec, cmd: 'bundle exec rspec --color --format progress' do watch(%r{^spec/.+_spec\.rb$}) watch(%r{^lib/(.+)\.rb$}) do |match| "spec/#{match[1]}_spec.rb" end watch(%r{^lib/jekyll/algolia/overwrites/jekyll-algolia-site\.rb$}) do 'spec/jekyll...