RSpec to Minitest
Use Assertions method instead of RSpec expect.
Cases
expect(response.status).to eq 400| fn build_line_path(points: Vec<Point<Pixels>>, width: f32) -> Path<Pixels> { | |
| let mut path = Path::new(point(points[0].x, points[0].y)); | |
| let half_width = width / 2.0; | |
| let angle_threshold: f32 = 15.; | |
| // 4~6 for performance, 8~12 for medium, 16~24 for high quality | |
| const SEGMENT: usize = 0; | |
| let angle_threshold_cos = angle_threshold.to_radians().cos(); | |
| for i in 0..points.len() - 1 { |
| package main | |
| import ( | |
| "fmt" | |
| "time" | |
| ) | |
| type Node struct { | |
| children map[rune]*Node | |
| fail *Node |
| require('parser') | |
| input = "function foo() {}" | |
| buf = Parser::Source::Buffer.new("test", 1, source: input) | |
| tr = Parser::Source::TreeRewriter::new(buf) | |
| def range(buf, start_pos, end_pos) | |
| Parser::Source::Range::new(buf, start_pos, end_pos) | |
| end |
| (hello(world) 你好 (var)) | |
| (hello2(world)) |
| { | |
| "recommendations": [ | |
| "aeschli.vscode-css-formatter", | |
| "ahmadalli.vscode-nginx-conf", | |
| "aliariff.vscode-erb-beautify", | |
| "be5invis.toml", | |
| "bierner.markdown-preview-github-styles", | |
| "bradlc.vscode-tailwindcss", | |
| "bradymholt.pgformatter", | |
| "crystal-lang-tools.crystal-lang", |
| <?xml version="1.0" standalone="no"?> | |
| <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"> | |
| <svg style="border-radius: 0;" width="324" height="120" viewBox="0 0 324 120" version="1.1" xmlns="http://www.w3.org/2000/svg"> | |
| <g> | |
| <defs> | |
| <linearGradient id="avatar" x1="0" y1="0" x2="1" y2="1"> | |
| <stop offset="0%" stop-color="#ff6a00"/> | |
| <stop offset="100%" stop-color="#ff6a00"/> | |
| </linearGradient> | |
| </defs> |
| -- 创建名称为readonly的只读用户: | |
| create user social with password '123456'; | |
| -- 然后把在public这个schema下现有的所有表的select权限赋给readobly,并执行下面的SQL命令: | |
| grant select on select tables in schema public to social; | |
| -- 上面的命令只是把现有的表的权限给了readonly用户,如果此时创建了表,readonly用户还是不能读,需要使用下面的SQL把所建表的select权限也给用户readonly: | |
| alter default privileges in schema public grant select on tables to social; | |
| models: | |
| homeland: | |
| compress_with: | |
| type: tgz | |
| encrypt_with: | |
| type: openssl | |
| password: your-archive-password | |
| store_with: | |
| type: oss | |
| bucket: your-backup-bucket-name |
| # 实现钉钉扫描登录 | |
| # | |
| # 从钉钉 “移动应用接入 - 扫码登录” 开通,并获得 app_id 和 app_secret | |
| # 开通:https://open-dev.dingtalk.com/#/loginMan | |
| # | |
| # 这个流程只能实现简单登录,拿到用户 nick,dingId, openid, unionid | |
| # 文档:https://ding-doc.dingtalk.com/doc#/serverapi2/etaarr | |
| require "openssl" | |
| require "base64" | |
| require "faraday" |