[RailsWorld 2023] Untangling cables & demystifying twisted transistors
@octokit/rest.js は GitHub 社が提供する公式の REST API クライアントライブラリです。 以前この@octokit/rest.js のアーキテクチャがどうなっているか調査した 際、テストに @octokit/fixtures-server という別のパッケージが使われていることまではわかったものの、こいつが何をやっているのかまでは調べきれなかったので、今回はそのあたりを調査したメモです。 なお、 @octokit/rest.js は JavaScript 向けのクライアントライブラリですが、今回調べたモックサーバーについては特定の言語に依存せず利用できます。 調査時のパッケージバージョン 先にまとめ 登場するパッケージとその役割 @octokit/fixtures @octokit/fixtures-server @octokit/rest.js fixtur
When I was researching the topic of test fixtures, I couldn’t find much about their beginnings. My first search was about the name of the person who coined “test fixtures”. Unfortunately, that was not a fruitful endeavor. The next logical step was to look for the etymology of the phrase “test fixtures”, but the only search result that made sense was a Wikipedia page on the topic. Judging by the Wi
This is a quick post to describe how you can use test fixtures, data files on disk, with the Go testing package. Using fixtures with the Go testing package is quite straight forward because of two convenience features built into the go tool. First, when you run go test, for each package in scope, the test binary will be executed with its working directory set to the source directory of the package
フィードバック この P2 ブログの内容に関して質問やご意見がある場合は、WordPress.org アカウントでログインしてコメントできます (新規作成はこちら)。 このディレクトリには、構文解析とシリアル化のロジックをテストするためのフィクスチャファイルのセットが含まれています。 各テストは4つのフィクスチャファイルから構成されています: fixture-name.html: 元の投稿コンテンツ。fixture-name.parsed.json: このコンテンツに対する PEG パーサーの 期待される 出力 (JS と PHP の両方のバージョンのパーサーでの 実際の 出力に対してチェックされる)。fixture-name.json: 投稿コンテンツ内のブロックの 期待される 表現と、その属性およびネストされたコンテンツ。このファイルのコンテンツは、 実際の ブロックオブジェクトと比較
【Django】loaddataコマンドを使用してfixturesデータをデータベースにロード(初期データを投入)する方法PythonDjangomigrationJSONFixture 概要 Djangoでは、python manage.py loaddataコマンドを使用してfixturesデータをデータベースにロードできます。 これは初期データ投入時に使えます。今回は実際にやってみたので、本記事ではその方法を解説します。 実行手順 fixturesディレクトリ内のJSONファイルを作成します。 JSONであれば、ファイル名は必ず.json拡張子で終わる必要がありますが、JSONのほか、XMLやYAML形式でも書くことができます。 フィクスチャ (fixture) とは、 テストや開発のためのサンプルデータを含むファイルです。Django のデータベースに投入できるよう準備済みのデータ
test/fixtures/users.yml等に大量のデータを用意したい時って良くありますよね。 fixturesは、普通にerb効くので 以下の様にループで書く事が可能です。 <% 10.times do |idx| %> test_user_<%= idx %> id: <%= idx %> name: test_user_<%= idx %> <% end %> 上の例だと10個のnameが違うユーザーが出来上がりました。 性別とか年齢を複数のパターンで組み合わせたい場合はこんな感じ <% MALE = 1; FEMALE = 2 %> <% count = 0 %> <% [ MALE, FEMALE].each do | sex | %> <% [ 8, 10, 18, 20, 21, 30, 50].each do | age | %> test_user_<%= count
j次のブックマーク
k前のブックマーク
lあとで読む
eコメント一覧を開く
oページを開く