repo
stringlengths
5
92
file_url
stringlengths
80
287
file_path
stringlengths
5
197
content
stringlengths
0
32.8k
language
stringclasses
1 value
license
stringclasses
7 values
commit_sha
stringlengths
40
40
retrieved_at
stringdate
2026-01-04 15:37:27
2026-01-04 17:58:21
truncated
bool
2 classes
puppetlabs/puppet
https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/lib/puppet/parser/ast/branch.rb
lib/puppet/parser/ast/branch.rb
# frozen_string_literal: true # The parent class of all AST objects that contain other AST objects. # Everything but the really simple objects descend from this. It is # important to note that Branch objects contain other AST objects only -- # if you want to contain values, use a descendant of the AST::Leaf class. # ...
ruby
Apache-2.0
e227c27540975c25aa22d533a52424a9d2fc886a
2026-01-04T15:39:26.576514Z
false
puppetlabs/puppet
https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/lib/puppet/parser/compiler/catalog_validator.rb
lib/puppet/parser/compiler/catalog_validator.rb
# frozen_string_literal: true # Abstract class for a catalog validator that can be registered with the compiler to run at # a certain stage. class Puppet::Parser::Compiler class CatalogValidator PRE_FINISH = :pre_finish FINAL = :final # Returns true if the validator should run at the given stage. The de...
ruby
Apache-2.0
e227c27540975c25aa22d533a52424a9d2fc886a
2026-01-04T15:39:26.576514Z
false
puppetlabs/puppet
https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/lib/puppet/parser/compiler/catalog_validator/relationship_validator.rb
lib/puppet/parser/compiler/catalog_validator/relationship_validator.rb
# frozen_string_literal: true class Puppet::Parser::Compiler # Validator that asserts relationship metaparameters refer to valid resources class CatalogValidator::RelationshipValidator < CatalogValidator def validate catalog.resources.each do |resource| next unless resource.is_a?(Puppet::Parser::...
ruby
Apache-2.0
e227c27540975c25aa22d533a52424a9d2fc886a
2026-01-04T15:39:26.576514Z
false
puppetlabs/puppet
https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/lib/puppet/context/trusted_information.rb
lib/puppet/context/trusted_information.rb
# frozen_string_literal: true require_relative '../../puppet/trusted_external' # @api private class Puppet::Context::TrustedInformation # one of 'remote', 'local', or false, where 'remote' is authenticated via cert, # 'local' is trusted by virtue of running on the same machine (not a remote # request), and fals...
ruby
Apache-2.0
e227c27540975c25aa22d533a52424a9d2fc886a
2026-01-04T15:39:26.576514Z
false
puppetlabs/puppet
https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/lib/puppet/http/session.rb
lib/puppet/http/session.rb
# frozen_string_literal: true # The session is the mechanism by which services may be connected to and accessed. # # @api public class Puppet::HTTP::Session # capabilities for a site CAP_LOCALES = 'locales' CAP_JSON = 'json' # puppet version where locales mount was added SUPPORTED_LOCALES_MOUNT_AGENT_VERSIO...
ruby
Apache-2.0
e227c27540975c25aa22d533a52424a9d2fc886a
2026-01-04T15:39:26.576514Z
false
puppetlabs/puppet
https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/lib/puppet/http/errors.rb
lib/puppet/http/errors.rb
# frozen_string_literal: true module Puppet::HTTP # A base class for puppet http errors # @api public class HTTPError < Puppet::Error; end # A connection error such as if the server refuses the connection. # @api public class ConnectionError < HTTPError; end # A failure to route to the server such as i...
ruby
Apache-2.0
e227c27540975c25aa22d533a52424a9d2fc886a
2026-01-04T15:39:26.576514Z
false
puppetlabs/puppet
https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/lib/puppet/http/pool.rb
lib/puppet/http/pool.rb
# frozen_string_literal: true # A pool for persistent `Net::HTTP` connections. Connections are # stored in the pool indexed by their {Site}. # Connections are borrowed from the pool, yielded to the caller, and # released back into the pool. If a connection is expired, it will be # closed either when a connection to th...
ruby
Apache-2.0
e227c27540975c25aa22d533a52424a9d2fc886a
2026-01-04T15:39:26.576514Z
false
puppetlabs/puppet
https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/lib/puppet/http/response_converter.rb
lib/puppet/http/response_converter.rb
# frozen_string_literal: true module Puppet::HTTP::ResponseConverter module_function # Borrowed from puppetserver, see https://github.com/puppetlabs/puppetserver/commit/a1ebeaaa5af590003ccd23c89f808ba4f0c89609 def to_ruby_response(response) str_code = response.code.to_s # Copied from Net::HTTPResponse ...
ruby
Apache-2.0
e227c27540975c25aa22d533a52424a9d2fc886a
2026-01-04T15:39:26.576514Z
false
puppetlabs/puppet
https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/lib/puppet/http/proxy.rb
lib/puppet/http/proxy.rb
# frozen_string_literal: true require 'uri' require_relative '../../puppet/ssl/openssl_loader' module Puppet::HTTP::Proxy def self.proxy(uri) if http_proxy_host && !no_proxy?(uri) Net::HTTP.new(uri.host, uri.port, http_proxy_host, http_proxy_port, http_proxy_user, http_proxy_password) else http ...
ruby
Apache-2.0
e227c27540975c25aa22d533a52424a9d2fc886a
2026-01-04T15:39:26.576514Z
false
puppetlabs/puppet
https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/lib/puppet/http/response.rb
lib/puppet/http/response.rb
# frozen_string_literal: true # Represents the response returned from the server from an HTTP request. # # @api abstract # @api public class Puppet::HTTP::Response # @return [URI] the response url attr_reader :url # Create a response associated with the URL. # # @param [URI] url # @param [Integer] HTTP st...
ruby
Apache-2.0
e227c27540975c25aa22d533a52424a9d2fc886a
2026-01-04T15:39:26.576514Z
false
puppetlabs/puppet
https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/lib/puppet/http/pool_entry.rb
lib/puppet/http/pool_entry.rb
# frozen_string_literal: true # An entry in the peristent HTTP pool that references the connection and # an expiration time for the connection. # # @api private class Puppet::HTTP::PoolEntry attr_reader :connection, :verifier def initialize(connection, verifier, expiration_time) @connection = connection @...
ruby
Apache-2.0
e227c27540975c25aa22d533a52424a9d2fc886a
2026-01-04T15:39:26.576514Z
false
puppetlabs/puppet
https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/lib/puppet/http/response_net_http.rb
lib/puppet/http/response_net_http.rb
# frozen_string_literal: true # Adapts Net::HTTPResponse to Puppet::HTTP::Response # # @api public class Puppet::HTTP::ResponseNetHTTP < Puppet::HTTP::Response # Create a response associated with the URL. # # @param [URI] url # @param [Net::HTTPResponse] nethttp The response def initialize(url, nethttp) ...
ruby
Apache-2.0
e227c27540975c25aa22d533a52424a9d2fc886a
2026-01-04T15:39:26.576514Z
false
puppetlabs/puppet
https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/lib/puppet/http/resolver.rb
lib/puppet/http/resolver.rb
# frozen_string_literal: true # Resolver base class. Each resolver represents a different strategy for # resolving a service name into a list of candidate servers and ports. # # @abstract Subclass and override {#resolve} to create a new resolver. # @api public class Puppet::HTTP::Resolver # # Create a new resolver...
ruby
Apache-2.0
e227c27540975c25aa22d533a52424a9d2fc886a
2026-01-04T15:39:26.576514Z
false
puppetlabs/puppet
https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/lib/puppet/http/dns.rb
lib/puppet/http/dns.rb
# frozen_string_literal: true require 'resolv' module Puppet::HTTP class DNS class CacheEntry attr_reader :records, :ttl, :resolution_time def initialize(records) @records = records @resolution_time = Time.now @ttl = choose_lowest_ttl(records) end def choose_low...
ruby
Apache-2.0
e227c27540975c25aa22d533a52424a9d2fc886a
2026-01-04T15:39:26.576514Z
false
puppetlabs/puppet
https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/lib/puppet/http/client.rb
lib/puppet/http/client.rb
# frozen_string_literal: true # The HTTP client provides methods for making `GET`, `POST`, etc requests to # HTTP(S) servers. It also provides methods for resolving Puppetserver REST # service endpoints using SRV records and settings (such as `server_list`, # `server`, `ca_server`, etc). Once a service endpoint has be...
ruby
Apache-2.0
e227c27540975c25aa22d533a52424a9d2fc886a
2026-01-04T15:39:26.576514Z
false
puppetlabs/puppet
https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/lib/puppet/http/external_client.rb
lib/puppet/http/external_client.rb
# frozen_string_literal: true # Adapts an external http_client_class to the HTTP client API. The former # is typically registered by puppetserver and only implements a subset of # the Puppet::Network::HTTP::Connection methods. As a result, only the # `get` and `post` methods are supported. Calling `delete`, etc will #...
ruby
Apache-2.0
e227c27540975c25aa22d533a52424a9d2fc886a
2026-01-04T15:39:26.576514Z
false
puppetlabs/puppet
https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/lib/puppet/http/factory.rb
lib/puppet/http/factory.rb
# frozen_string_literal: true require_relative '../../puppet/ssl/openssl_loader' require 'net/http' require_relative '../../puppet/http' # Factory for `Net::HTTP` objects. # # Encapsulates the logic for creating a `Net::HTTP` object based on the # specified {Site} and puppet settings. # # @api private class Puppet::H...
ruby
Apache-2.0
e227c27540975c25aa22d533a52424a9d2fc886a
2026-01-04T15:39:26.576514Z
false
puppetlabs/puppet
https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/lib/puppet/http/service.rb
lib/puppet/http/service.rb
# frozen_string_literal: true # Represents an abstract Puppet web service. # # @abstract Subclass and implement methods for the service's REST APIs. # @api public class Puppet::HTTP::Service # @return [URI] the url associated with this service attr_reader :url # @return [Array<Symbol>] available services SERV...
ruby
Apache-2.0
e227c27540975c25aa22d533a52424a9d2fc886a
2026-01-04T15:39:26.576514Z
false
puppetlabs/puppet
https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/lib/puppet/http/redirector.rb
lib/puppet/http/redirector.rb
# frozen_string_literal: true # Handle HTTP redirects # # @api private class Puppet::HTTP::Redirector # Create a new redirect handler # # @param [Integer] redirect_limit maximum number of redirects allowed # # @api private def initialize(redirect_limit) @redirect_limit = redirect_limit end # Deter...
ruby
Apache-2.0
e227c27540975c25aa22d533a52424a9d2fc886a
2026-01-04T15:39:26.576514Z
false
puppetlabs/puppet
https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/lib/puppet/http/retry_after_handler.rb
lib/puppet/http/retry_after_handler.rb
# frozen_string_literal: true require 'date' require 'time' # Parse information relating to responses containing a Retry-After headers # # @api private class Puppet::HTTP::RetryAfterHandler # Create a handler to allow the system to sleep between HTTP requests # # @param [Integer] retry_limit number of retries a...
ruby
Apache-2.0
e227c27540975c25aa22d533a52424a9d2fc886a
2026-01-04T15:39:26.576514Z
false
puppetlabs/puppet
https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/lib/puppet/http/site.rb
lib/puppet/http/site.rb
# frozen_string_literal: true # Represents a site to which HTTP connections are made. It is a value # object, and is suitable for use in a hash. If two sites are equal, # then a persistent connection made to the first site, can be re-used # for the second. # # @api private class Puppet::HTTP::Site attr_reader :schem...
ruby
Apache-2.0
e227c27540975c25aa22d533a52424a9d2fc886a
2026-01-04T15:39:26.576514Z
false
puppetlabs/puppet
https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/lib/puppet/http/service/report.rb
lib/puppet/http/service/report.rb
# frozen_string_literal: true # The Report service is used to submit run reports to the report server. # # @api public # class Puppet::HTTP::Service::Report < Puppet::HTTP::Service # @return [String] Default API for the report service API = '/puppet/v3' # Use `Puppet::HTTP::Session.route_to(:report)` to create ...
ruby
Apache-2.0
e227c27540975c25aa22d533a52424a9d2fc886a
2026-01-04T15:39:26.576514Z
false
puppetlabs/puppet
https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/lib/puppet/http/service/compiler.rb
lib/puppet/http/service/compiler.rb
# frozen_string_literal: true # The Compiler service is used to submit and retrieve data from the # puppetserver. # # @api public class Puppet::HTTP::Service::Compiler < Puppet::HTTP::Service # @return [String] Default API for the Compiler service API = '/puppet/v3' # Use `Puppet::HTTP::Session.route_to(:puppet...
ruby
Apache-2.0
e227c27540975c25aa22d533a52424a9d2fc886a
2026-01-04T15:39:26.576514Z
false
puppetlabs/puppet
https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/lib/puppet/http/service/ca.rb
lib/puppet/http/service/ca.rb
# frozen_string_literal: true # The CA service is used to handle certificate related REST requests. # # @api public class Puppet::HTTP::Service::Ca < Puppet::HTTP::Service # @return [Hash] default headers for the ca service HEADERS = { 'Accept' => 'text/plain' }.freeze # @return [String] default API for the ca ...
ruby
Apache-2.0
e227c27540975c25aa22d533a52424a9d2fc886a
2026-01-04T15:39:26.576514Z
false
puppetlabs/puppet
https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/lib/puppet/http/service/puppetserver.rb
lib/puppet/http/service/puppetserver.rb
# frozen_string_literal: true # The puppetserver service. # # @api public # class Puppet::HTTP::Service::Puppetserver < Puppet::HTTP::Service # Use `Puppet::HTTP::Session.route_to(:puppetserver)` to create or get an instance of this class. # # @param [Puppet::HTTP::Client] client # @param [Puppet::HTTP::Sessio...
ruby
Apache-2.0
e227c27540975c25aa22d533a52424a9d2fc886a
2026-01-04T15:39:26.576514Z
false
puppetlabs/puppet
https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/lib/puppet/http/service/file_server.rb
lib/puppet/http/service/file_server.rb
# frozen_string_literal: true require_relative '../../../puppet/file_serving/metadata' # The FileServer service is used to retrieve file metadata and content. # # @api public # class Puppet::HTTP::Service::FileServer < Puppet::HTTP::Service # @return [String] Default API for the FileServer service API = '/puppet/...
ruby
Apache-2.0
e227c27540975c25aa22d533a52424a9d2fc886a
2026-01-04T15:39:26.576514Z
false
puppetlabs/puppet
https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/lib/puppet/http/resolver/srv.rb
lib/puppet/http/resolver/srv.rb
# frozen_string_literal: true # Resolve a service using DNS SRV records. # # @api public class Puppet::HTTP::Resolver::SRV < Puppet::HTTP::Resolver # Create an DNS SRV resolver. # # @param [Puppet::HTTP::Client] client # @param [String] domain srv domain # @param [Resolv::DNS] dns # def initialize(client...
ruby
Apache-2.0
e227c27540975c25aa22d533a52424a9d2fc886a
2026-01-04T15:39:26.576514Z
false
puppetlabs/puppet
https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/lib/puppet/http/resolver/settings.rb
lib/puppet/http/resolver/settings.rb
# frozen_string_literal: true # Resolve a service using settings. This is the default resolver if none of the # other resolvers find a functional connection. # # @api public class Puppet::HTTP::Resolver::Settings < Puppet::HTTP::Resolver # Resolve a service using the default server and port settings for this service...
ruby
Apache-2.0
e227c27540975c25aa22d533a52424a9d2fc886a
2026-01-04T15:39:26.576514Z
false
puppetlabs/puppet
https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/lib/puppet/http/resolver/server_list.rb
lib/puppet/http/resolver/server_list.rb
# frozen_string_literal: true # Use the server_list setting to resolve a service. This resolver is only used # if server_list is set either on the command line or in the configuration file. # # @api public class Puppet::HTTP::Resolver::ServerList < Puppet::HTTP::Resolver # Create a server list resolver. # # @par...
ruby
Apache-2.0
e227c27540975c25aa22d533a52424a9d2fc886a
2026-01-04T15:39:26.576514Z
false
cucumber/cucumber-ruby
https://github.com/cucumber/cucumber-ruby/blob/50c37055b0e5e74de50a026756ca915f0f7b7820/features/lib/profile_steps.rb
features/lib/profile_steps.rb
# frozen_string_literal: true Given('the following profile(s) is/are defined:') do |profiles| write_file('cucumber.yml', profiles) end Then('the {word} profile should be used') do |profile| expect(command_line.all_output).to include_output(profile) end
ruby
MIT
50c37055b0e5e74de50a026756ca915f0f7b7820
2026-01-04T15:43:43.142161Z
false
cucumber/cucumber-ruby
https://github.com/cucumber/cucumber-ruby/blob/50c37055b0e5e74de50a026756ca915f0f7b7820/features/lib/support/parameter_types.rb
features/lib/support/parameter_types.rb
# frozen_string_literal: true ParameterType( name: 'list', regexp: /.*/, transformer: ->(s) { s.split(/,\s+/) }, use_for_snippets: false ) class ExecutionStatus def initialize(name) @passed = name == 'pass' end def validates?(exit_code) @passed ? exit_code.zero? : exit_code.positive? end end ...
ruby
MIT
50c37055b0e5e74de50a026756ca915f0f7b7820
2026-01-04T15:43:43.142161Z
false
cucumber/cucumber-ruby
https://github.com/cucumber/cucumber-ruby/blob/50c37055b0e5e74de50a026756ca915f0f7b7820/features/lib/support/output.rb
features/lib/support/output.rb
# frozen_string_literal: true require 'rspec/expectations' def clean_output(output) output.split("\n").map do |line| next if line.include?(CUCUMBER_FEATURES_PATH) line .gsub(/\e\[([;\d]+)?m/, '') # Drop colors .gsub(/^.*cucumber_process\.rb.*$\n/, '') .gsub(/^\d+m\d+\.\d+...
ruby
MIT
50c37055b0e5e74de50a026756ca915f0f7b7820
2026-01-04T15:43:43.142161Z
false
cucumber/cucumber-ruby
https://github.com/cucumber/cucumber-ruby/blob/50c37055b0e5e74de50a026756ca915f0f7b7820/features/lib/support/json.rb
features/lib/support/json.rb
# frozen_string_literal: true module JSONWorld def normalise_json(json) json.each do |feature| elements = feature.fetch('elements') { [] } elements.each do |scenario| normalise_scenario_json(scenario) end end end private def normalise_scenario_json(scenario) scenario['st...
ruby
MIT
50c37055b0e5e74de50a026756ca915f0f7b7820
2026-01-04T15:43:43.142161Z
false
cucumber/cucumber-ruby
https://github.com/cucumber/cucumber-ruby/blob/50c37055b0e5e74de50a026756ca915f0f7b7820/features/lib/support/env.rb
features/lib/support/env.rb
# frozen_string_literal: true require 'cucumber/formatter/ansicolor' require 'securerandom' require 'nokogiri' CUCUMBER_FEATURES_PATH = 'features/lib' Before do |scenario| @original_cwd = Dir.pwd # We limit the length to avoid issues on Windows where sometimes the creation # of the temporary directory fails du...
ruby
MIT
50c37055b0e5e74de50a026756ca915f0f7b7820
2026-01-04T15:43:43.142161Z
false
cucumber/cucumber-ruby
https://github.com/cucumber/cucumber-ruby/blob/50c37055b0e5e74de50a026756ca915f0f7b7820/features/lib/support/feature_factory.rb
features/lib/support/feature_factory.rb
# frozen_string_literal: true module FeatureFactory def create_feature(name = generate_feature_name) gherkin = <<~GHERKIN Feature: #{name} #{yield} GHERKIN write_file filename(name), gherkin end def create_feature_ja(name = generate_feature_name) gherkin = <<~GHERKIN # language...
ruby
MIT
50c37055b0e5e74de50a026756ca915f0f7b7820
2026-01-04T15:43:43.142161Z
false
cucumber/cucumber-ruby
https://github.com/cucumber/cucumber-ruby/blob/50c37055b0e5e74de50a026756ca915f0f7b7820/features/lib/support/junit.rb
features/lib/support/junit.rb
# frozen_string_literal: true module JUnitWorld def replace_junit_time(time) time.gsub(/\d+\.\d\d+/m, '0.05') end end World(JUnitWorld)
ruby
MIT
50c37055b0e5e74de50a026756ca915f0f7b7820
2026-01-04T15:43:43.142161Z
false
cucumber/cucumber-ruby
https://github.com/cucumber/cucumber-ruby/blob/50c37055b0e5e74de50a026756ca915f0f7b7820/features/lib/support/command_line.rb
features/lib/support/command_line.rb
# frozen_string_literal: true require 'rspec/expectations' require 'rspec/mocks' require 'rake' require 'cucumber/rake/task' class MockKernel attr_reader :exit_status def exit(status) @exit_status = status status unless status.zero? end end class CommandLine include ::RSpec::Mocks::ExampleMethods ...
ruby
MIT
50c37055b0e5e74de50a026756ca915f0f7b7820
2026-01-04T15:43:43.142161Z
false
cucumber/cucumber-ruby
https://github.com/cucumber/cucumber-ruby/blob/50c37055b0e5e74de50a026756ca915f0f7b7820/features/lib/support/step_definitions.rb
features/lib/support/step_definitions.rb
# frozen_string_literal: true module StepDefinitionsWorld def step_definition(expression, content, keyword: 'Given') if content.is_a?(String) one_line_step_definition(keyword, expression, content) else block_step_definition(keyword, expression, content) end end def one_line_step_definiti...
ruby
MIT
50c37055b0e5e74de50a026756ca915f0f7b7820
2026-01-04T15:43:43.142161Z
false
cucumber/cucumber-ruby
https://github.com/cucumber/cucumber-ruby/blob/50c37055b0e5e74de50a026756ca915f0f7b7820/features/lib/support/filesystem.rb
features/lib/support/filesystem.rb
# frozen_string_literal: true def write_file(path, content) FileUtils.mkdir_p(File.dirname(path)) File.open(path, 'w') { |file| file.write(content) } end
ruby
MIT
50c37055b0e5e74de50a026756ca915f0f7b7820
2026-01-04T15:43:43.142161Z
false
cucumber/cucumber-ruby
https://github.com/cucumber/cucumber-ruby/blob/50c37055b0e5e74de50a026756ca915f0f7b7820/features/lib/step_definitions/command_line_steps.rb
features/lib/step_definitions/command_line_steps.rb
# frozen_string_literal: true When('I run `cucumber{}`') do |args| execute_cucumber(args) end When('I run `bundle exec ruby {}`') do |filename| execute_ruby(filename) end When('I run `(bundle exec )rake {word}`') do |task| execute_rake(task) end When('I run the feature with the progress formatter') do execu...
ruby
MIT
50c37055b0e5e74de50a026756ca915f0f7b7820
2026-01-04T15:43:43.142161Z
false
cucumber/cucumber-ruby
https://github.com/cucumber/cucumber-ruby/blob/50c37055b0e5e74de50a026756ca915f0f7b7820/features/lib/step_definitions/junit_steps.rb
features/lib/step_definitions/junit_steps.rb
# frozen_string_literal: true Then('the junit output file {string} should contain:') do |actual_file, text| actual = IO.read("#{File.expand_path('.')}/#{actual_file}") actual = remove_self_ref(replace_junit_time(actual)) expect(actual).to be_similar_output_than(text) end
ruby
MIT
50c37055b0e5e74de50a026756ca915f0f7b7820
2026-01-04T15:43:43.142161Z
false
cucumber/cucumber-ruby
https://github.com/cucumber/cucumber-ruby/blob/50c37055b0e5e74de50a026756ca915f0f7b7820/features/lib/step_definitions/message_steps.rb
features/lib/step_definitions/message_steps.rb
# frozen_string_literal: true Then('messages types should be:') do |expected_types| message_types = command_line.stdout(format: :messages).map(&:keys).flatten.compact expect(expected_types.split("\n")).to eq(message_types) end Then('output should be valid NDJSON') do expect { command_line.stdout(format: :messa...
ruby
MIT
50c37055b0e5e74de50a026756ca915f0f7b7820
2026-01-04T15:43:43.142161Z
false
cucumber/cucumber-ruby
https://github.com/cucumber/cucumber-ruby/blob/50c37055b0e5e74de50a026756ca915f0f7b7820/features/lib/step_definitions/cucumber_steps.rb
features/lib/step_definitions/cucumber_steps.rb
# frozen_string_literal: true Given('a directory without standard Cucumber project directory structure') do FileUtils.cd('.') do FileUtils.rm_rf 'features' if File.directory?('features') end end Given('log only formatter is declared') do write_file('features/support/log_only_formatter.rb', [ 'class LogO...
ruby
MIT
50c37055b0e5e74de50a026756ca915f0f7b7820
2026-01-04T15:43:43.142161Z
false
cucumber/cucumber-ruby
https://github.com/cucumber/cucumber-ruby/blob/50c37055b0e5e74de50a026756ca915f0f7b7820/features/lib/step_definitions/scenarios_and_steps.rb
features/lib/step_definitions/scenarios_and_steps.rb
# frozen_string_literal: true Given('the standard step definitions') do write_file( 'features/step_definitions/steps.rb', [ step_definition('/^this step passes$/', ''), step_definition('/^this step raises an error$/', "raise 'error'"), step_definition('/^this step is pending$/', 'pending'),...
ruby
MIT
50c37055b0e5e74de50a026756ca915f0f7b7820
2026-01-04T15:43:43.142161Z
false
cucumber/cucumber-ruby
https://github.com/cucumber/cucumber-ruby/blob/50c37055b0e5e74de50a026756ca915f0f7b7820/features/lib/step_definitions/filesystem_steps.rb
features/lib/step_definitions/filesystem_steps.rb
# frozen_string_literal: true Given('a directory named {string}') do |path| FileUtils.mkdir_p(path) end Given('a file named {string} with:') do |path, content| write_file(path, content) end Given('an empty file named {string}') do |path| write_file(path, '') end Then('a file named {string} should exist') do |...
ruby
MIT
50c37055b0e5e74de50a026756ca915f0f7b7820
2026-01-04T15:43:43.142161Z
false
cucumber/cucumber-ruby
https://github.com/cucumber/cucumber-ruby/blob/50c37055b0e5e74de50a026756ca915f0f7b7820/features/lib/step_definitions/json_steps.rb
features/lib/step_definitions/json_steps.rb
# frozen_string_literal: true Then('it should fail with JSON:') do |json| expect(command_line).to have_failed actual = normalise_json(JSON.parse(command_line.stdout)) expected = JSON.parse(json) expect(actual).to eq expected end Then('it should pass with JSON:') do |json| expect(command_line).to have_succe...
ruby
MIT
50c37055b0e5e74de50a026756ca915f0f7b7820
2026-01-04T15:43:43.142161Z
false
cucumber/cucumber-ruby
https://github.com/cucumber/cucumber-ruby/blob/50c37055b0e5e74de50a026756ca915f0f7b7820/features/lib/step_definitions/html_steps.rb
features/lib/step_definitions/html_steps.rb
# frozen_string_literal: true Then('output should be html with title {string}') do |title| document = Nokogiri::HTML.parse(command_line.stdout) expect(document.xpath('//title').text).to eq(title) end
ruby
MIT
50c37055b0e5e74de50a026756ca915f0f7b7820
2026-01-04T15:43:43.142161Z
false
cucumber/cucumber-ruby
https://github.com/cucumber/cucumber-ruby/blob/50c37055b0e5e74de50a026756ca915f0f7b7820/features/lib/step_definitions/cucumber_cli_steps.rb
features/lib/step_definitions/cucumber_cli_steps.rb
# frozen_string_literal: true Then('I should see the CLI help') do expect(command_line.stdout).to include('Usage:') end Then('cucumber lists all the supported languages') do sample_languages = %w[Arabic български Pirate English 日本語] sample_languages.each do |language| expect(command_line.stdout.force_encodi...
ruby
MIT
50c37055b0e5e74de50a026756ca915f0f7b7820
2026-01-04T15:43:43.142161Z
false
cucumber/cucumber-ruby
https://github.com/cucumber/cucumber-ruby/blob/50c37055b0e5e74de50a026756ca915f0f7b7820/spec/spec_helper.rb
spec/spec_helper.rb
# frozen_string_literal: true ENV['CUCUMBER_COLORS'] = nil $LOAD_PATH.unshift(File.dirname(__FILE__)) require 'simplecov_setup' require 'cucumber' RSpec.configure do |c| c.before { Cucumber::Term::ANSIColor.coloring = true } end
ruby
MIT
50c37055b0e5e74de50a026756ca915f0f7b7820
2026-01-04T15:43:43.142161Z
false
cucumber/cucumber-ruby
https://github.com/cucumber/cucumber-ruby/blob/50c37055b0e5e74de50a026756ca915f0f7b7820/spec/support/standard_step_actions.rb
spec/support/standard_step_actions.rb
# frozen_string_literal: true # Filter that activates steps with obvious pass / fail behaviour class StandardStepActions < Cucumber::Core::Filter.new def test_case(test_case) test_steps = test_case.test_steps.map do |step| case step.text when /fail/ step.with_action { raise Failure } wh...
ruby
MIT
50c37055b0e5e74de50a026756ca915f0f7b7820
2026-01-04T15:43:43.142161Z
false
cucumber/cucumber-ruby
https://github.com/cucumber/cucumber-ruby/blob/50c37055b0e5e74de50a026756ca915f0f7b7820/spec/support/fake_objects.rb
spec/support/fake_objects.rb
# frozen_string_literal: true require 'cucumber/core/filter' # The following fake objects was previously declared within `describe` scope. # Declaring into scope did not isolate them. # # Moving these into a dedicated support file explicitly states that these are available globally as soon as they are required once. ...
ruby
MIT
50c37055b0e5e74de50a026756ca915f0f7b7820
2026-01-04T15:43:43.142161Z
false
cucumber/cucumber-ruby
https://github.com/cucumber/cucumber-ruby/blob/50c37055b0e5e74de50a026756ca915f0f7b7820/spec/support/shared_context/http_server.rb
spec/support/shared_context/http_server.rb
RSpec.shared_context 'an HTTP server accepting file requests' do subject(:server) { http_server_class.new } let(:http_server_class) do Class.new do attr_reader :read_io, :write_io, :received_headers, :request_count attr_accessor :received_body_io def initialize @read_io, @write_io = ...
ruby
MIT
50c37055b0e5e74de50a026756ca915f0f7b7820
2026-01-04T15:43:43.142161Z
false
cucumber/cucumber-ruby
https://github.com/cucumber/cucumber-ruby/blob/50c37055b0e5e74de50a026756ca915f0f7b7820/spec/cucumber/hooks_spec.rb
spec/cucumber/hooks_spec.rb
# frozen_string_literal: true require 'cucumber/hooks' module Cucumber module Hooks shared_examples_for 'a source node' do it 'responds to text' do expect(subject.text).to be_a(String) end it 'responds to location' do expect(subject.location).to eq(location) end it...
ruby
MIT
50c37055b0e5e74de50a026756ca915f0f7b7820
2026-01-04T15:43:43.142161Z
false
cucumber/cucumber-ruby
https://github.com/cucumber/cucumber-ruby/blob/50c37055b0e5e74de50a026756ca915f0f7b7820/spec/cucumber/cucumber_spec.rb
spec/cucumber/cucumber_spec.rb
# frozen_string_literal: true describe Cucumber do describe '.deprecate' do it 'outputs a message to $stderr' do allow(Kernel).to receive(:warn) expect(Kernel).to receive(:warn).with( a_string_including('WARNING: #some_method is deprecated and will be removed after version 1.0.0. Use #some_o...
ruby
MIT
50c37055b0e5e74de50a026756ca915f0f7b7820
2026-01-04T15:43:43.142161Z
false
cucumber/cucumber-ruby
https://github.com/cucumber/cucumber-ruby/blob/50c37055b0e5e74de50a026756ca915f0f7b7820/spec/cucumber/query_spec.rb
spec/cucumber/query_spec.rb
# frozen_string_literal: true def source_names %w[attachments empty hooks minimal rules] end def sources source_names.map { |name| "#{Dir.pwd}/spec/support/#{name}.ndjson" } end def queries { 'findAllPickles' => ->(query) { query.find_all_pickles.length }, 'findAllTestCases' => ->(query) { query.find_a...
ruby
MIT
50c37055b0e5e74de50a026756ca915f0f7b7820
2026-01-04T15:43:43.142161Z
false
cucumber/cucumber-ruby
https://github.com/cucumber/cucumber-ruby/blob/50c37055b0e5e74de50a026756ca915f0f7b7820/spec/cucumber/project_initializer_spec.rb
spec/cucumber/project_initializer_spec.rb
# frozen_string_literal: true describe Cucumber::ProjectInitializer do let(:command_line_config) { described_class.new } before { allow(command_line_config).to receive(:puts) } context 'when there are no existing files' do around(:example) do |example| dir = Dir.mktmpdir original_dir = Dir.pwd ...
ruby
MIT
50c37055b0e5e74de50a026756ca915f0f7b7820
2026-01-04T15:43:43.142161Z
false
cucumber/cucumber-ruby
https://github.com/cucumber/cucumber-ruby/blob/50c37055b0e5e74de50a026756ca915f0f7b7820/spec/cucumber/configuration_spec.rb
spec/cucumber/configuration_spec.rb
# frozen_string_literal: true require 'spec_helper' module Cucumber describe Configuration do describe '.default' do subject { described_class.default } it 'has an autoload_code_paths containing the standard support and step_definitions folders' do expect(subject.autoload_code_paths).to inc...
ruby
MIT
50c37055b0e5e74de50a026756ca915f0f7b7820
2026-01-04T15:43:43.142161Z
false
cucumber/cucumber-ruby
https://github.com/cucumber/cucumber-ruby/blob/50c37055b0e5e74de50a026756ca915f0f7b7820/spec/cucumber/runtime_spec.rb
spec/cucumber/runtime_spec.rb
# frozen_string_literal: true require 'spec_helper' module Cucumber describe Runtime do subject { described_class.new(options) } let(:options) { {} } describe '#features_paths' do let(:options) { { paths: ['foo/bar/baz.feature', 'foo/bar/features/baz.feature', 'other_features'] } } it 'ret...
ruby
MIT
50c37055b0e5e74de50a026756ca915f0f7b7820
2026-01-04T15:43:43.142161Z
false
cucumber/cucumber-ruby
https://github.com/cucumber/cucumber-ruby/blob/50c37055b0e5e74de50a026756ca915f0f7b7820/spec/cucumber/constantize_spec.rb
spec/cucumber/constantize_spec.rb
# frozen_string_literal: true require 'spec_helper' module Html end module Cucumber describe Constantize do include described_class it 'loads pretty formatter' do clazz = constantize('Cucumber::Formatter::Pretty') expect(clazz.name).to eq 'Cucumber::Formatter::Pretty' end it 'fails t...
ruby
MIT
50c37055b0e5e74de50a026756ca915f0f7b7820
2026-01-04T15:43:43.142161Z
false
cucumber/cucumber-ruby
https://github.com/cucumber/cucumber-ruby/blob/50c37055b0e5e74de50a026756ca915f0f7b7820/spec/cucumber/step_match_search_spec.rb
spec/cucumber/step_match_search_spec.rb
# frozen_string_literal: true require 'cucumber/step_match_search' require 'cucumber/glue/dsl' require 'cucumber/glue/registry_and_more' require 'cucumber/configuration' module Cucumber describe StepMatchSearch do let(:search) { described_class.new(registry.method(:step_matches), configuration) } let(:regis...
ruby
MIT
50c37055b0e5e74de50a026756ca915f0f7b7820
2026-01-04T15:43:43.142161Z
false
cucumber/cucumber-ruby
https://github.com/cucumber/cucumber-ruby/blob/50c37055b0e5e74de50a026756ca915f0f7b7820/spec/cucumber/events_spec.rb
spec/cucumber/events_spec.rb
# frozen_string_literal: true module Cucumber describe Events do it 'builds a registry without failing' do expect { described_class.registry }.not_to raise_error end end end
ruby
MIT
50c37055b0e5e74de50a026756ca915f0f7b7820
2026-01-04T15:43:43.142161Z
false
cucumber/cucumber-ruby
https://github.com/cucumber/cucumber-ruby/blob/50c37055b0e5e74de50a026756ca915f0f7b7820/spec/cucumber/running_test_case_spec.rb
spec/cucumber/running_test_case_spec.rb
# frozen_string_literal: true require 'cucumber/running_test_case' require 'cucumber/core' require 'cucumber/core/gherkin/writer' module Cucumber describe RunningTestCase do include Core include Core::Gherkin::Writer attr_accessor :wrapped_test_case, :core_test_case let(:result) { double(:result, ...
ruby
MIT
50c37055b0e5e74de50a026756ca915f0f7b7820
2026-01-04T15:43:43.142161Z
false
cucumber/cucumber-ruby
https://github.com/cucumber/cucumber-ruby/blob/50c37055b0e5e74de50a026756ca915f0f7b7820/spec/cucumber/step_match_spec.rb
spec/cucumber/step_match_spec.rb
# frozen_string_literal: true require 'spec_helper' require 'cucumber/glue/step_definition' require 'cucumber/glue/registry_and_more' module Cucumber describe StepMatch do let(:word) { '[[:word:]]' } before do @registry = Glue::RegistryAndMore.new(nil, Configuration.new) end def stepdef(stri...
ruby
MIT
50c37055b0e5e74de50a026756ca915f0f7b7820
2026-01-04T15:43:43.142161Z
false
cucumber/cucumber-ruby
https://github.com/cucumber/cucumber-ruby/blob/50c37055b0e5e74de50a026756ca915f0f7b7820/spec/cucumber/file_specs_spec.rb
spec/cucumber/file_specs_spec.rb
# frozen_string_literal: true require 'cucumber/file_specs' module Cucumber describe FileSpecs do let(:file_specs) { described_class.new(['features/foo.feature:1:2:3', 'features/bar.feature:4:5:6']) } let(:locations) { file_specs.locations } let(:files) { file_specs.files } it 'parses locations fro...
ruby
MIT
50c37055b0e5e74de50a026756ca915f0f7b7820
2026-01-04T15:43:43.142161Z
false
cucumber/cucumber-ruby
https://github.com/cucumber/cucumber-ruby/blob/50c37055b0e5e74de50a026756ca915f0f7b7820/spec/cucumber/multiline_argument/data_table_spec.rb
spec/cucumber/multiline_argument/data_table_spec.rb
# frozen_string_literal: true require 'spec_helper' require 'cucumber/multiline_argument/data_table' module Cucumber module MultilineArgument describe DataTable do subject(:table) { described_class.from([%w[one four seven], %w[4444 55555 666666]]) } it 'has rows' do expect(table.cells_rows[...
ruby
MIT
50c37055b0e5e74de50a026756ca915f0f7b7820
2026-01-04T15:43:43.142161Z
false
cucumber/cucumber-ruby
https://github.com/cucumber/cucumber-ruby/blob/50c37055b0e5e74de50a026756ca915f0f7b7820/spec/cucumber/formatter/pretty_spec.rb
spec/cucumber/formatter/pretty_spec.rb
# frozen_string_literal: true require 'spec_helper' require 'cucumber/formatter/spec_helper' require 'cucumber/formatter/pretty' require 'cucumber/cli/options' module Cucumber module Formatter describe Pretty do extend SpecHelperDsl include SpecHelper context 'with no options' do befo...
ruby
MIT
50c37055b0e5e74de50a026756ca915f0f7b7820
2026-01-04T15:43:43.142161Z
false
cucumber/cucumber-ruby
https://github.com/cucumber/cucumber-ruby/blob/50c37055b0e5e74de50a026756ca915f0f7b7820/spec/cucumber/formatter/http_io_spec.rb
spec/cucumber/formatter/http_io_spec.rb
# frozen_string_literal: true require 'stringio' require 'webrick' require 'webrick/https' require 'spec_helper' require 'cucumber/formatter/io' require 'support/shared_context/http_server' module Cucumber module Formatter class DummyFormatter include Io def initialize(config = nil); end def...
ruby
MIT
50c37055b0e5e74de50a026756ca915f0f7b7820
2026-01-04T15:43:43.142161Z
false
cucumber/cucumber-ruby
https://github.com/cucumber/cucumber-ruby/blob/50c37055b0e5e74de50a026756ca915f0f7b7820/spec/cucumber/formatter/io_http_buffer_spec.rb
spec/cucumber/formatter/io_http_buffer_spec.rb
# frozen_string_literal: true require 'stringio' require 'webrick' require 'webrick/https' require 'spec_helper' require 'cucumber/formatter/io' require 'support/shared_context/http_server' module Cucumber module Formatter class DummyReporter def report(banner); end end describe IOHTTPBuffer do ...
ruby
MIT
50c37055b0e5e74de50a026756ca915f0f7b7820
2026-01-04T15:43:43.142161Z
false
cucumber/cucumber-ruby
https://github.com/cucumber/cucumber-ruby/blob/50c37055b0e5e74de50a026756ca915f0f7b7820/spec/cucumber/formatter/console_spec.rb
spec/cucumber/formatter/console_spec.rb
# frozen_string_literal: true require 'cucumber/configuration' require 'cucumber/formatter/console' module Cucumber module Formatter describe Console do include described_class it 'indents when padding is positive' do res = indent('a line', 2) expect(res).to eq ' a line' end ...
ruby
MIT
50c37055b0e5e74de50a026756ca915f0f7b7820
2026-01-04T15:43:43.142161Z
false
cucumber/cucumber-ruby
https://github.com/cucumber/cucumber-ruby/blob/50c37055b0e5e74de50a026756ca915f0f7b7820/spec/cucumber/formatter/rerun_spec.rb
spec/cucumber/formatter/rerun_spec.rb
# frozen_string_literal: true require 'cucumber/formatter/rerun' require 'cucumber/core' require 'cucumber/core/gherkin/writer' require 'support/standard_step_actions' require 'cucumber/configuration' require 'support/fake_objects' module Cucumber module Formatter describe Rerun do include Cucumber::Core:...
ruby
MIT
50c37055b0e5e74de50a026756ca915f0f7b7820
2026-01-04T15:43:43.142161Z
false
cucumber/cucumber-ruby
https://github.com/cucumber/cucumber-ruby/blob/50c37055b0e5e74de50a026756ca915f0f7b7820/spec/cucumber/formatter/fail_fast_spec.rb
spec/cucumber/formatter/fail_fast_spec.rb
# frozen_string_literal: true require 'cucumber/formatter/fail_fast' require 'cucumber/core' require 'cucumber/core/gherkin/writer' require 'cucumber/core/test/result' require 'cucumber/core/filter' require 'cucumber' require 'support/standard_step_actions' module Cucumber module Formatter describe FailFast do ...
ruby
MIT
50c37055b0e5e74de50a026756ca915f0f7b7820
2026-01-04T15:43:43.142161Z
false
cucumber/cucumber-ruby
https://github.com/cucumber/cucumber-ruby/blob/50c37055b0e5e74de50a026756ca915f0f7b7820/spec/cucumber/formatter/ansicolor_spec.rb
spec/cucumber/formatter/ansicolor_spec.rb
# frozen_string_literal: true require 'spec_helper' require 'cucumber/formatter/ansicolor' module Cucumber module Formatter describe ANSIColor do include described_class it 'wraps passed_param with bold green and reset to green' do expect(passed_param('foo')).to eq "\e[32m\e[1mfoo\e[0m\e[0m...
ruby
MIT
50c37055b0e5e74de50a026756ca915f0f7b7820
2026-01-04T15:43:43.142161Z
false
cucumber/cucumber-ruby
https://github.com/cucumber/cucumber-ruby/blob/50c37055b0e5e74de50a026756ca915f0f7b7820/spec/cucumber/formatter/message_spec.rb
spec/cucumber/formatter/message_spec.rb
# frozen_string_literal: true require 'spec_helper' require 'cucumber/formatter/spec_helper' require 'cucumber/formatter/message' require 'cucumber/cli/options' module Cucumber module Formatter describe Message do extend SpecHelperDsl include SpecHelper before(:each) do Cucumber::Term...
ruby
MIT
50c37055b0e5e74de50a026756ca915f0f7b7820
2026-01-04T15:43:43.142161Z
false
cucumber/cucumber-ruby
https://github.com/cucumber/cucumber-ruby/blob/50c37055b0e5e74de50a026756ca915f0f7b7820/spec/cucumber/formatter/curl_option_parser_spec.rb
spec/cucumber/formatter/curl_option_parser_spec.rb
# frozen_string_literal: true require 'stringio' require 'webrick' require 'webrick/https' require 'spec_helper' require 'cucumber/formatter/io' require 'support/shared_context/http_server' describe Cucumber::Formatter::CurlOptionParser do describe '.parse' do context 'when a simple URL is given' do it 'r...
ruby
MIT
50c37055b0e5e74de50a026756ca915f0f7b7820
2026-01-04T15:43:43.142161Z
false
cucumber/cucumber-ruby
https://github.com/cucumber/cucumber-ruby/blob/50c37055b0e5e74de50a026756ca915f0f7b7820/spec/cucumber/formatter/console_counts_spec.rb
spec/cucumber/formatter/console_counts_spec.rb
# frozen_string_literal: true require 'cucumber/configuration' require 'cucumber/formatter/console_counts' module Cucumber module Formatter describe ConsoleCounts do it 'works for zero' do config = Configuration.new counts = described_class.new(config) expect(counts.to_s).to eq "0 ...
ruby
MIT
50c37055b0e5e74de50a026756ca915f0f7b7820
2026-01-04T15:43:43.142161Z
false
cucumber/cucumber-ruby
https://github.com/cucumber/cucumber-ruby/blob/50c37055b0e5e74de50a026756ca915f0f7b7820/spec/cucumber/formatter/interceptor_spec.rb
spec/cucumber/formatter/interceptor_spec.rb
# frozen_string_literal: true require 'spec_helper' require 'cucumber/formatter/interceptor' describe Cucumber::Formatter::Interceptor::Pipe do let(:pipe) { instance_spy(IO) } describe '#wrap!' do it 'raises an ArgumentError if its not passed :stderr/:stdout' do expect { described_class.wrap(:nonsense)...
ruby
MIT
50c37055b0e5e74de50a026756ca915f0f7b7820
2026-01-04T15:43:43.142161Z
false
cucumber/cucumber-ruby
https://github.com/cucumber/cucumber-ruby/blob/50c37055b0e5e74de50a026756ca915f0f7b7820/spec/cucumber/formatter/duration_spec.rb
spec/cucumber/formatter/duration_spec.rb
# frozen_string_literal: true require 'spec_helper' require 'cucumber/formatter/duration' module Cucumber module Formatter describe Duration do include described_class it 'formats ms' do expect(format_duration(0.002103)).to eq '0m0.002s' end it 'formats m' do expect(for...
ruby
MIT
50c37055b0e5e74de50a026756ca915f0f7b7820
2026-01-04T15:43:43.142161Z
false
cucumber/cucumber-ruby
https://github.com/cucumber/cucumber-ruby/blob/50c37055b0e5e74de50a026756ca915f0f7b7820/spec/cucumber/formatter/url_reporter_spec.rb
spec/cucumber/formatter/url_reporter_spec.rb
# frozen_string_literal: true require 'stringio' require 'uri' require 'cucumber/formatter/url_reporter' module Cucumber module Formatter describe URLReporter do let(:io) { StringIO.new } subject { described_class.new(io) } describe '#report' do it 'displays the provided string' do ...
ruby
MIT
50c37055b0e5e74de50a026756ca915f0f7b7820
2026-01-04T15:43:43.142161Z
false
cucumber/cucumber-ruby
https://github.com/cucumber/cucumber-ruby/blob/50c37055b0e5e74de50a026756ca915f0f7b7820/spec/cucumber/formatter/json_spec.rb
spec/cucumber/formatter/json_spec.rb
# frozen_string_literal: true require 'spec_helper' require 'cucumber/formatter/spec_helper' require 'cucumber/formatter/json' require 'cucumber/cli/options' require 'json' module Cucumber module Formatter describe Json do extend SpecHelperDsl include SpecHelper before(:each) do @out ...
ruby
MIT
50c37055b0e5e74de50a026756ca915f0f7b7820
2026-01-04T15:43:43.142161Z
false
cucumber/cucumber-ruby
https://github.com/cucumber/cucumber-ruby/blob/50c37055b0e5e74de50a026756ca915f0f7b7820/spec/cucumber/formatter/backtrace_filter_spec.rb
spec/cucumber/formatter/backtrace_filter_spec.rb
# frozen_string_literal: true require 'cucumber/formatter/backtrace_filter' describe Cucumber::Formatter::BacktraceFilter do subject(:exception) { exception_klass.new } let(:exception_klass) do Class.new(StandardError) do def _trace static_trace + dynamic_trace + realistic_trace end ...
ruby
MIT
50c37055b0e5e74de50a026756ca915f0f7b7820
2026-01-04T15:43:43.142161Z
false
cucumber/cucumber-ruby
https://github.com/cucumber/cucumber-ruby/blob/50c37055b0e5e74de50a026756ca915f0f7b7820/spec/cucumber/formatter/junit_spec.rb
spec/cucumber/formatter/junit_spec.rb
# frozen_string_literal: true require 'spec_helper' require 'cucumber/formatter/spec_helper' require 'cucumber/formatter/junit' require 'nokogiri' module Cucumber module Formatter class TestDoubleJunitFormatter < ::Cucumber::Formatter::Junit attr_reader :written_files def initialize(config) ...
ruby
MIT
50c37055b0e5e74de50a026756ca915f0f7b7820
2026-01-04T15:43:43.142161Z
false
cucumber/cucumber-ruby
https://github.com/cucumber/cucumber-ruby/blob/50c37055b0e5e74de50a026756ca915f0f7b7820/spec/cucumber/formatter/progress_spec.rb
spec/cucumber/formatter/progress_spec.rb
# frozen_string_literal: true require 'spec_helper' require 'cucumber/formatter/spec_helper' require 'cucumber/formatter/progress' require 'cucumber/cli/options' module Cucumber module Formatter describe Progress do extend SpecHelperDsl include SpecHelper before(:each) do Cucumber::Te...
ruby
MIT
50c37055b0e5e74de50a026756ca915f0f7b7820
2026-01-04T15:43:43.142161Z
false
cucumber/cucumber-ruby
https://github.com/cucumber/cucumber-ruby/blob/50c37055b0e5e74de50a026756ca915f0f7b7820/spec/cucumber/formatter/publish_banner_printer_spec.rb
spec/cucumber/formatter/publish_banner_printer_spec.rb
# frozen_string_literal: true require 'spec_helper' require 'cucumber/formatter/spec_helper' require 'cucumber/formatter/publish_banner_printer' module Cucumber module Formatter describe PublishBannerPrinter do extend SpecHelperDsl include SpecHelper before do Cucumber::Term::ANSIColo...
ruby
MIT
50c37055b0e5e74de50a026756ca915f0f7b7820
2026-01-04T15:43:43.142161Z
false
cucumber/cucumber-ruby
https://github.com/cucumber/cucumber-ruby/blob/50c37055b0e5e74de50a026756ca915f0f7b7820/spec/cucumber/formatter/spec_helper.rb
spec/cucumber/formatter/spec_helper.rb
# frozen_string_literal: true module Cucumber module Formatter module SpecHelperDsl attr_reader :feature_content, :step_defs, :feature_filename def define_feature(string, feature_file = 'spec.feature') @feature_content = string @feature_filename = feature_file end def de...
ruby
MIT
50c37055b0e5e74de50a026756ca915f0f7b7820
2026-01-04T15:43:43.142161Z
false
cucumber/cucumber-ruby
https://github.com/cucumber/cucumber-ruby/blob/50c37055b0e5e74de50a026756ca915f0f7b7820/spec/cucumber/formatter/query/pickle_step_by_test_step_spec.rb
spec/cucumber/formatter/query/pickle_step_by_test_step_spec.rb
# frozen_string_literal: true require 'spec_helper' require 'cucumber/formatter/spec_helper' require 'cucumber/formatter/query/pickle_step_by_test_step' module Cucumber module Formatter module Query describe PickleStepByTestStep do extend SpecHelperDsl include SpecHelper before(:e...
ruby
MIT
50c37055b0e5e74de50a026756ca915f0f7b7820
2026-01-04T15:43:43.142161Z
false
cucumber/cucumber-ruby
https://github.com/cucumber/cucumber-ruby/blob/50c37055b0e5e74de50a026756ca915f0f7b7820/spec/cucumber/formatter/query/step_definitions_by_test_step_spec.rb
spec/cucumber/formatter/query/step_definitions_by_test_step_spec.rb
# frozen_string_literal: true require 'spec_helper' require 'cucumber/formatter/spec_helper' require 'cucumber/formatter/query/step_definitions_by_test_step' module Cucumber module Formatter module Query describe StepDefinitionsByTestStep do extend SpecHelperDsl include SpecHelper ...
ruby
MIT
50c37055b0e5e74de50a026756ca915f0f7b7820
2026-01-04T15:43:43.142161Z
false
cucumber/cucumber-ruby
https://github.com/cucumber/cucumber-ruby/blob/50c37055b0e5e74de50a026756ca915f0f7b7820/spec/cucumber/formatter/query/hook_by_test_step_spec.rb
spec/cucumber/formatter/query/hook_by_test_step_spec.rb
# frozen_string_literal: true require 'spec_helper' require 'cucumber/formatter/spec_helper' require 'cucumber/formatter/query/hook_by_test_step' describe Cucumber::Formatter::Query::HookByTestStep do extend Cucumber::Formatter::SpecHelperDsl include Cucumber::Formatter::SpecHelper before(:each) do Cucumbe...
ruby
MIT
50c37055b0e5e74de50a026756ca915f0f7b7820
2026-01-04T15:43:43.142161Z
false
cucumber/cucumber-ruby
https://github.com/cucumber/cucumber-ruby/blob/50c37055b0e5e74de50a026756ca915f0f7b7820/spec/cucumber/formatter/query/pickle_by_test_spec.rb
spec/cucumber/formatter/query/pickle_by_test_spec.rb
# frozen_string_literal: true require 'spec_helper' require 'cucumber/formatter/spec_helper' require 'cucumber/formatter/query/pickle_by_test' module Cucumber module Formatter module Query describe PickleByTest do extend SpecHelperDsl include SpecHelper before(:each) do ...
ruby
MIT
50c37055b0e5e74de50a026756ca915f0f7b7820
2026-01-04T15:43:43.142161Z
false
cucumber/cucumber-ruby
https://github.com/cucumber/cucumber-ruby/blob/50c37055b0e5e74de50a026756ca915f0f7b7820/spec/cucumber/formatter/query/test_case_started_by_test_case_spec.rb
spec/cucumber/formatter/query/test_case_started_by_test_case_spec.rb
# frozen_string_literal: true require 'spec_helper' require 'cucumber/formatter/spec_helper' require 'cucumber/formatter/query/test_case_started_by_test_case' module Cucumber module Formatter module Query describe TestCaseStartedByTestCase do extend SpecHelperDsl include SpecHelper ...
ruby
MIT
50c37055b0e5e74de50a026756ca915f0f7b7820
2026-01-04T15:43:43.142161Z
false
cucumber/cucumber-ruby
https://github.com/cucumber/cucumber-ruby/blob/50c37055b0e5e74de50a026756ca915f0f7b7820/spec/cucumber/runtime/before_hooks_spec.rb
spec/cucumber/runtime/before_hooks_spec.rb
# frozen_string_literal: true require 'spec_helper' require 'cucumber/runtime/hooks_examples' require 'cucumber/runtime/before_hooks' module Cucumber class Runtime describe BeforeHooks do let(:subject) { described_class.new(id_generator, hooks, scenario, event_bus) } describe '#apply_to' do ...
ruby
MIT
50c37055b0e5e74de50a026756ca915f0f7b7820
2026-01-04T15:43:43.142161Z
false
cucumber/cucumber-ruby
https://github.com/cucumber/cucumber-ruby/blob/50c37055b0e5e74de50a026756ca915f0f7b7820/spec/cucumber/runtime/hooks_examples.rb
spec/cucumber/runtime/hooks_examples.rb
# frozen_string_literal: true require 'spec_helper' require 'cucumber/messages/helpers/id_generator' RSpec.shared_examples 'events are fired when applying hooks' do let(:id_generator) { Cucumber::Messages::Helpers::IdGenerator::Incrementing.new } let(:scenario) { double } let(:event_bus) { double } let(:hooks...
ruby
MIT
50c37055b0e5e74de50a026756ca915f0f7b7820
2026-01-04T15:43:43.142161Z
false
cucumber/cucumber-ruby
https://github.com/cucumber/cucumber-ruby/blob/50c37055b0e5e74de50a026756ca915f0f7b7820/spec/cucumber/runtime/meta_message_builder_spec.rb
spec/cucumber/runtime/meta_message_builder_spec.rb
# frozen_string_literal: true require 'spec_helper' require 'cucumber/runtime/meta_message_builder' describe Cucumber::Runtime::MetaMessageBuilder do describe '.build_meta_message' do subject { described_class.build_meta_message } it { is_expected.to be_a(Cucumber::Messages::Meta) } it 'has a protocol...
ruby
MIT
50c37055b0e5e74de50a026756ca915f0f7b7820
2026-01-04T15:43:43.142161Z
false
cucumber/cucumber-ruby
https://github.com/cucumber/cucumber-ruby/blob/50c37055b0e5e74de50a026756ca915f0f7b7820/spec/cucumber/runtime/after_hooks_spec.rb
spec/cucumber/runtime/after_hooks_spec.rb
# frozen_string_literal: true require 'spec_helper' require 'cucumber/runtime/hooks_examples' require 'cucumber/runtime/after_hooks' module Cucumber class Runtime describe AfterHooks do let(:subject) { described_class.new(id_generator, hooks, scenario, event_bus) } describe '#apply_to' do ...
ruby
MIT
50c37055b0e5e74de50a026756ca915f0f7b7820
2026-01-04T15:43:43.142161Z
false
cucumber/cucumber-ruby
https://github.com/cucumber/cucumber-ruby/blob/50c37055b0e5e74de50a026756ca915f0f7b7820/spec/cucumber/runtime/support_code_spec.rb
spec/cucumber/runtime/support_code_spec.rb
# frozen_string_literal: true require 'spec_helper' module Cucumber describe Runtime::SupportCode do let(:user_interface) { double('user interface') } subject { described_class.new(user_interface, configuration) } let(:configuration) { Configuration.new(options) } let(:options) { {} } let(:dsl)...
ruby
MIT
50c37055b0e5e74de50a026756ca915f0f7b7820
2026-01-04T15:43:43.142161Z
false
cucumber/cucumber-ruby
https://github.com/cucumber/cucumber-ruby/blob/50c37055b0e5e74de50a026756ca915f0f7b7820/spec/cucumber/world/pending_spec.rb
spec/cucumber/world/pending_spec.rb
# frozen_string_literal: true require 'spec_helper' require 'cucumber/glue/registry_and_more' require 'cucumber/configuration' module Cucumber describe 'Pending' do before(:each) do registry = Glue::RegistryAndMore.new(Runtime.new, Configuration.new) registry.begin_scenario(double('scenario').as_nul...
ruby
MIT
50c37055b0e5e74de50a026756ca915f0f7b7820
2026-01-04T15:43:43.142161Z
false
cucumber/cucumber-ruby
https://github.com/cucumber/cucumber-ruby/blob/50c37055b0e5e74de50a026756ca915f0f7b7820/spec/cucumber/term/banner_spec.rb
spec/cucumber/term/banner_spec.rb
# frozen_string_literal: true require 'cucumber/term/banner' describe Cucumber::Term::Banner do include described_class describe '.display_banner' do let(:io) { StringIO.new } context 'when a string is provided' do it 'outputs a nice banner to IO surrounded by a bold green border' do displ...
ruby
MIT
50c37055b0e5e74de50a026756ca915f0f7b7820
2026-01-04T15:43:43.142161Z
false
cucumber/cucumber-ruby
https://github.com/cucumber/cucumber-ruby/blob/50c37055b0e5e74de50a026756ca915f0f7b7820/spec/cucumber/filters/retry_spec.rb
spec/cucumber/filters/retry_spec.rb
# frozen_string_literal: true require 'cucumber' require 'cucumber/filters/retry' require 'cucumber/core/gherkin/writer' require 'cucumber/configuration' require 'cucumber/core/test/case' require 'cucumber/core' require 'cucumber/events' describe Cucumber::Filters::Retry do include Cucumber::Core::Gherkin::Writer ...
ruby
MIT
50c37055b0e5e74de50a026756ca915f0f7b7820
2026-01-04T15:43:43.142161Z
false
cucumber/cucumber-ruby
https://github.com/cucumber/cucumber-ruby/blob/50c37055b0e5e74de50a026756ca915f0f7b7820/spec/cucumber/filters/activate_steps_spec.rb
spec/cucumber/filters/activate_steps_spec.rb
# frozen_string_literal: true require 'cucumber/filters/activate_steps' require 'cucumber/core/gherkin/writer' require 'cucumber/core' describe Cucumber::Filters::ActivateSteps do include Cucumber::Core::Gherkin::Writer include Cucumber::Core let(:step_match) { double(activate: activated_test_step) } let(:ac...
ruby
MIT
50c37055b0e5e74de50a026756ca915f0f7b7820
2026-01-04T15:43:43.142161Z
false
cucumber/cucumber-ruby
https://github.com/cucumber/cucumber-ruby/blob/50c37055b0e5e74de50a026756ca915f0f7b7820/spec/cucumber/filters/tag_limits_spec.rb
spec/cucumber/filters/tag_limits_spec.rb
# frozen_string_literal: true require 'cucumber/filters/tag_limits' describe Cucumber::Filters::TagLimits do subject(:filter) { described_class.new(tag_limits, receiver) } let(:tag_limits) { double(:tag_limits) } let(:receiver) { double(:receiver) } let(:gated_receiver) { double(:gated_receiver) } let(:te...
ruby
MIT
50c37055b0e5e74de50a026756ca915f0f7b7820
2026-01-04T15:43:43.142161Z
false
cucumber/cucumber-ruby
https://github.com/cucumber/cucumber-ruby/blob/50c37055b0e5e74de50a026756ca915f0f7b7820/spec/cucumber/filters/gated_receiver_spec.rb
spec/cucumber/filters/gated_receiver_spec.rb
# frozen_string_literal: true require 'cucumber/filters/gated_receiver' describe Cucumber::Filters::GatedReceiver do subject(:gated_receiver) { described_class.new(receiver) } let(:receiver) { double(:receiver) } let(:test_cases) { [double(:test_case), double(:test_case)] } describe '#test_case' do it '...
ruby
MIT
50c37055b0e5e74de50a026756ca915f0f7b7820
2026-01-04T15:43:43.142161Z
false