Skills Plugins MCP Prompt Model 博客 我的中心

rspec-skill

Generates RSpec tests in Ruby with describe/context/it blocks, matchers, let/before hooks, and mocking. Use when user mentions "RSpec", "describe do", "expect().to", "Ruby test". Triggers on: "RSpec", "expect().to eq()", "describe do", "Ruby test", "spec file".

DeepseekModel 官方收录技能 质量 优秀 · 78 v1.0.0

获取

https://deepseekmodel.com/api/download.php?id=lambdatest-agent-skills-rspec-skill-skill-md&format=skill
下载 .skill 标准格式,含 system_prompt 与 model_config,导入任意 Agent 框架即可使用
.skill 文件中 system_prompt 字段的实际内容。
name rspec-skill description Generates RSpec tests in Ruby with describe/context/it blocks, matchers, let/before hooks, and mocking. Use when user mentions "RSpec", "describe do", "expect().to", "Ruby test". Triggers on: "RSpec", "expect().to eq()", "describe do", "Ruby test", "spec file". languages ["Ruby"] category unit-testing license MIT metadata {"author":"TestMu AI","version":"1.0"} RSpec Testing Skill Core Patterns Basic Test RSpec .describe Calculator do subject( :calculator ) { described_class.new } describe '#add' do it 'adds two positive numbers' do expect(calculator.add( 2 , 3 )).to eq( 5 ) end it 'handles negative numbers' do expect(calculator.add(- 1 , 1 )).to eq( 0 ) end end describe '#divide' do it 'divides evenly' do expect(calculator.divide( 10 , 2 )).to eq( 5 ) end it 'raises on zero divisor' do expect { calculator.divide( 10 , 0 ) }.to raise_error( ZeroDivisionError ) end end end Matchers # Equality expect(actual).to eq(expected) # == expect(actual).to eql(expected) # eql? expect(actual).to equal(expected) # equal? (same object) expect(actual).to be(expected) # equal? # Comparison expect(value).to be > 5 expect(value).to be_between( 1 , 10 ).inclusive # Truthiness expect(value).to be_truthy expect(value).to be_falsey expect(value).to be_nil # Collections expect(array).to include ( 3 ) expect(array).to contain_exactly( 1 , 2 , 3 ) expect(array).to match_array([ 3 , 1 , 2 ]) expect(hash).to include ( name: 'Alice' ) # Strings expect(str).to include ( 'hello' ) expect(str).to start_with( 'He' ) expect(str).to match( /\d+/ ) # Types expect(obj).to be_a( String ) expect(obj).to be_an_instance_of( MyClass ) # Exceptions expect { method }.to raise_error( StandardError ) expect { method }.to raise_error( StandardError , /message/ ) # Change expect { user.activate }.to change(user, :active ).from( false ).to( true ) expect { list.push( 1 ) }.to change(list, :size ).by( 1 ) Hooks and Let RSpec .describe UserService do let( :repo ) { instance_double( UserRepository ) } let( :service ) { described_class.new(repo) } before( :each ) do allow(repo).to receive( :save ).and_return( true ) end after( :each ) { cleanup } before( :all ) { setup_database } after( :all ) { teardown_database } context 'when creating a user' do it 'saves to repository' do service.create( 'Alice' , 'alice@test.com' ) expect(repo).to have_received( :save ).once end end end Mocking and Stubbing # Doubles user = double( 'User' , name: 'Alice' , email: 'alice@test.com' ) user = instance_double( User , name: 'Alice' ) # Stubs allow(service).to receive( :fetch ).and_return(data) allow(service).to receive( :fetch ).with( 'id' ).and_return(user) # Expectations expect(service).to receive( :save ).once expect(service).to receive( :notify ).with( 'alice@test.com' ) expect(service).not_to receive( :delete ) Shared Examples RSpec .shared_examples 'a valid model' do it { is_expected.to be_valid } it { is_expected.to respond_to( :save ) } end RSpec .describe User do subject { described_class.new( name: 'Alice' ) } it_behaves_like 'a valid model' end Anti-Patterns Bad Good Why before with heavy setup let (lazy) Only evaluates when used No contexts context 'when...' Clear scenarios Instance variables let blocks Cleaner, lazier should syntax expect().to Modern RSpec Setup: gem install rspec then rspec --init Run: bundle exec rspec or rspec spec/models/user_spec.rb Config: .rspec file with --format documentation --color Deep Patterns For advanced patterns, debugging guides, CI/CD integration, and best practices, see reference/playbook.md .
Agent 识别该技能的关键词,点击任意一个即可复制。

该技能未提供触发词。

下载的 .skill 包内含以下字段。
字段 说明
format格式标识(skill/v1)
skill_id技能唯一 ID
name技能名称
version版本号
description技能描述
category所属分类(数组)
trigger_words触发词列表
tags标签列表
source来源标识
source_url来源链接(本页地址)
exported_at导出时间(每次下载生成)
system_prompt系统提示词正文
model_config模型参数:provider / model / temperature / max_tokens / top_p
examples示例
install_guide各平台导入说明(Coze / Dify / Claude / 自定义框架)
同一份技能可按不同平台格式导出。
.skill 标准格式,含 system_prompt 与 model_config,导入任意 Agent 框架即可使用 下载
.skillpro 增强格式,额外含脚本 / 工具 / 依赖 / 钩子占位 下载
.json 纯 JSON 导出,只含 system_prompt 与模型参数 下载
Coze 带 frontmatter 的 Markdown,Coze 平台导入用 下载
Dify Dify DSL,创建应用后直接导入 下载

每日精选 Skill 推荐,免费送到你邮箱

输入邮箱,每天接收一个精选 AI Agent 技能推荐。完全免费,持续更新。

验证码 --

提交后我们会发送一封确认邮件,点击邮件里的链接才会开始收信。

完全免费,取消任意时间。我们不会发送垃圾邮件。