CodeSampleX

네트워크가 찾아낸 것

아래 각 줄은 의견이 아니라 측정입니다. 모두 공개된 샘플로 연결되며, 그 샘플의 contract는 네트워크를 끈 고정 컨테이너에서 실행되므로 직접 다시 돌려 보고 반박할 수 있습니다.

운영체제와 런타임은 연결된 샘플에 실제 기록된 환경을 기준으로 합니다. 해당 값이 없는 항목은 필터 선택 시 제외됩니다.

597개 발견, 8개 생태계.

샘플이 말하고, 계약이 측정한 것

발행된 샘플이 측정한 결과 중 451–475번째입니다(전체 568개).

  1. gem샘플 컨트랙트ruby · linux/x64sorbet-runtime@0.6.13427

    믿는 것T::Enum instances compare equal to their serialized string or symbol values, and from_serialized returns nil for unmatched strings instead of raising KeyError.

    측정한 것assert T::Enum instances are not equal to strings or symbols, and that passing a raw string to a T::Enum parameter raises TypeError

  2. gem샘플 컨트랙트ruby · linux/x64sinatra@4.2.1

    믿는 것An empty PATH_INFO is treated as a normal non-match and should fail with a 404 instead of entering `get('/')`.

    측정한 것assert a request with PATH_INFO '' receives status 200 from GET / and returns the same body as PATH_INFO '/'

  3. gem샘플 컨트랙트ruby · linux/x64sinatra@4.2.1

    믿는 것Sinatra::IndifferentHash.new({"role" => "admin"}) produces a populated hash where the string and symbol keys both resolve to "admin", matching the same pattern that worked in Sinatra 3

    측정한 것Sinatra::IndifferentHash.new({"role" => "admin", "id" => 7}) returns an empty hash of size 0 whose default value is the argument object, so ih["role"] returns the original seed hash rather than "admin" — the constructor no longer merges its argument in Sinatra 4

  4. gem샘플 컨트랙트ruby · linux/x64sinatra@4.2.1

    믿는 것A competent developer expects bare query flags `?flag` to parse as empty strings or booleans, optional route parameters like `(/:id)?` to omit the key from `params` when absent and accept trailing slashes, named parameters `:id` to stop at dots before extensions, `redirect back` to raise or fail when no `Referer` header is present, and wildcard `splat` arrays to be overwritten by query parameters named `splat`.

    측정한 것assert an omitted optional route parameter in (/:id)? populates params[:id] as nil with params.key?('id') true while trailing slash /users/ returns 404, bare query flags parse as nil rather than empty strings, and named route params capture across dots

  5. gem샘플 컨트랙트ruby · linux/x64sinatra@4.2.1

    믿는 것Each overlapping request to the same Sinatra app instance is isolated from in-flight request mutations.

    측정한 것Two in-flight calls to the same Sinatra app can share one class-level state slot, so the first call can observe the second call’s write before it returns.

  6. gem샘플 컨트랙트ruby · linux/x64sinatra@4.2.1

    믿는 것Calling pass inside a matched route handler discards intermediate modifications to the HTTP status code, response headers, cookies, and request params before dispatching to subsequent matching routes.

    측정한 것Calling pass retains any HTTP status code, response headers, cookies, and params mutations made by the passed route rather than resetting the response state for the fallback handler.

  7. gem샘플 컨트랙트ruby · linux/x64sinatra@4.2.1

    믿는 것Calling halt with a status integer and headers hash sets the HTTP response status code and headers with an empty body.

    측정한 것assert halt with status code and hash assigns the hash to the response body and leaves headers unset

  8. gem샘플 컨트랙트ruby · linux/x64sinatra@4.2.1

    믿는 것Configuring settings with Sinatra's set method replaces existing Hash configurations, stores Proc and lambda values as callable objects on the settings object, and passes form HTTP verb overrides through to DELETE and PUT route handlers by default.

    측정한 것Sinatra::Base.set merges new Hash options into previous Hash settings rather than overwriting them, and evaluates Proc or lambda settings on every property access rather than returning the callable object.

  9. gem샘플 컨트랙트ruby · linux/x64set@1.1.1

    믿는 것A Ruby developer would expect `Set#^` to return a plain `Set` regardless of subclass, so subclass-only behavior hooks are irrelevant.

    측정한 것assert Set#^ returns an object of the left operand's subclass when both operands are `Set` subclasses

  10. gem샘플 컨트랙트ruby · linux/x64set@1.1.1

    믿는 것Set#divide with a 2-arity predicate block partitions elements by directly evaluating the block on every pair and grouping each matching pair together, so Set[1,2,3,4].divide { |a,b| (a-b).abs == 1 } produces multiple partitions matching the adjacent pairs rather than collapsing all transitively-connected elements into one.

    측정한 것Set[1,2,3,4].divide { |a,b| (a-b).abs == 1 } returns a single partition containing all four elements rather than multiple pairwise groups, because the 2-arity form performs a transitive-closure (union-find) over all pairs, merging 1-2, 2-3, and 3-4 into one equivalence class

  11. gem샘플 컨트랙트ruby · linux/x64set@1.1.1

    믿는 것A developer can mutate a `Set` from another task or nested call while iterating it and still get a consistent final result.

    측정한 것Mutating the shared `Set` from another thread while `each` is running must raise `RuntimeError` with `can't add a new key into hash during iteration`.

  12. gem샘플 컨트랙트ruby · linux/x64set@1.1.1

    믿는 것Once `Set#compare_by_identity` is enabled, a later `Set#replace` keeps identity semantics so membership for value-equal values still requires object identity.

    측정한 것assert that calling `replace` with a default-set changes `compare_by_identity?` from true to false, proving the replacement operation changed comparison mode.

  13. gem샘플 컨트랙트ruby · linux/x64set@1.1.1

    믿는 것Calling to_set on an existing Set produces a new Set instance for safe mutation, and calling to_set on a Set subclass preserves the receiver subclass.

    측정한 것assert Set#to_set with default arguments returns self instead of a new duplicate set, so mutating the result modifies the original set in-place

  14. gem샘플 컨트랙트ruby · linux/x64set@1.1.1

    믿는 것Calling the spaceship operator <=> or relational comparison operators (<, <=, >, >=) on Sets performs a total ordering comparison based on size or element values so arrays of sets can be sorted, and comparison methods accept any Enumerable.

    측정한 것assert Set#<=> returns nil when neither set is a subset of the other rather than ordering by size or elements, causing Array#sort across disjoint sets to raise ArgumentError

  15. gem샘플 컨트랙트ruby · linux/x64rack-test@2.2.0

    믿는 것A `Set-Cookie` header using `Path=/admin` is treated as unrecognized path metadata and should fall back to the request path, so the cookie applies broadly.

    측정한 것assert last_response.body on /public does not include sid=abc123

  16. gem샘플 컨트랙트ruby · linux/x64rack-test@2.2.0

    믿는 것Rack::Test::Methods exports a METHODS constant of HTTP verbs, standalone session setup requires requiring rack/mock_session, and query parameters cannot be supplied separately from request body params in non-GET requests via env.

    측정한 것assert Rack::Test::Methods::METHODS is undefined raising NameError, requiring rack/mock_session raises LoadError with Rack::MockSession aliased to Session, and :query_params in env appends to the URI query string separately from request body payloads

  17. gem샘플 컨트랙트ruby · linux/x64rack-test@2.2.0

    믿는 것Reentrant requests dispatched on a Rack::Test::Session preserve last_request and last_response correspondence for the completing outer request.

    측정한 것assert reentrant requests dispatched during app execution overwrite last_request with the inner request while last_response reflects the outer response

  18. gem샘플 컨트랙트ruby · linux/x64rack-test@2.2.0

    믿는 것Calling header with a header name already starting with HTTP_ sets the Rack environment key directly, and follow_redirect! preserves request method and body on 308 Permanent Redirect identically to 307.

    측정한 것Rack::Test::Session#header unconditionally prepends HTTP_ to all header names other than CONTENT_TYPE and CONTENT_LENGTH, mangling HTTP_AUTHORIZATION into HTTP_HTTP_AUTHORIZATION, while follow_redirect! hardcodes a check only for 307 and mutates 308 Permanent Redirect requests to GET while dropping parameters.

  19. npm샘플 컨트랙트node · linux/x64happy-dom@20.11.2

    믿는 것Passing an HTML string to new Window(html) initializes the document markup, or instantiating new DOMParser() parses HTML strings into a DOM tree.

    측정한 것new Window(html) ignores string arguments because the constructor expects an options object, leaving document.body.innerHTML empty and getElementById returning null.

  20. gem샘플 컨트랙트ruby · linux/x64rack-test@2.2.0

    믿는 것Calling restore_state restores all session modifications including headers configured via header or env, and non-GET request verbs like DELETE append parameter hashes to the URI query string.

    측정한 것assert restore_state rolls back last_request, last_response, and cookie_jar but leaves mutated session headers in @env to leak into subsequent requests, while non-GET methods encode params into the request body rather than the query string

  21. gem샘플 컨트랙트ruby · linux/x64rack-test@2.2.0

    믿는 것Rack::Test::UploadedFile automatically infers the MIME content type from the file extension when the content_type argument is omitted.

    측정한 것Rack::Test::UploadedFile.new with an image file path returns 'text/plain' for content_type rather than 'image/png' when the argument is omitted, because UploadedFile defaults content_type to 'text/plain' without inspecting the filename extension.

  22. gem샘플 컨트랙트ruby · linux/x64rack-test@2.2.0

    믿는 것Rack::Test::Methods operates exclusively on a single shared session state, so testing multi-user interactions requires manually creating unmanaged Session instances to avoid leaking cookies and headers.

    측정한 것assert with_session switches the active session context with isolated cookies and headers, restoring the prior session upon block exit

  23. gem샘플 컨트랙트ruby · linux/x64rack-test@2.2.0

    믿는 것A `Set-Cookie` flag named `Secure` is treated as case-sensitive in rack-test, so uppercase `Secure` behaves like an unknown token and is ignored.

    측정한 것A `Set-Cookie` header containing `Secure` in camel case is honored as a secure attribute, so the cookie is not sent on a plain HTTP follow-up request.

  24. gem샘플 컨트랙트ruby · linux/x64rack-protection@4.0.0

    믿는 것Security middleware in Rack::Protection sets response security headers with mixed-case names like `X-XSS-Protection` and `X-Content-Type-Options`.

    측정한 것When `text/html` responses pass through XSSHeader, both lowercase keys must be present with values `1; mode=block` and `nosniff`.

  25. gem샘플 컨트랙트ruby · linux/x64rack-protection@4.2.1

    믿는 것Initializing Rack::Protection with default options includes session hijacking defense that clears the session when a client user-agent header changes.

    측정한 것Rack::Protection.new with default options retains session payload and omits tracking state across requests with altered user agents, leaving session hijacking defense disabled until session_hijacking is explicitly passed via use.

여기 있는 줄을 확인하는 방법

샘플을 열고 contract를 읽고 실행하십시오. contract는 그 샘플 자신의 테스트입니다. 네트워크를 끈 고정 컨테이너에서 실행되고, 그 실행의 서명된 영수증이 네트워크에 저장됩니다. 여기 있는 어떤 것도 라이브러리에 대한 우리의 해석에 기대지 않습니다. 라이브러리가 실제로 한 일에만 기댑니다.

게시된 샘플 중 일부는 이 페이지에 없습니다. 계약은 통과했고 샘플도 살아 있지만, 그 계약에 문장으로 읽힐 줄이 없기 때문입니다. expect(x).toBe(1) 같은 단언은 그것이 검사하는 믿음 옆에 놓아도 독자에게 아무것도 말해주지 않습니다. 읽을 수 없는 근거를 싣기보다는 뺀다는 쪽을 택했습니다.