Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 67fe226

Browse files
fix spec helper
1 parent 1c23996 commit 67fe226

File tree

2 files changed

+14
-2
lines changed

2 files changed

+14
-2
lines changed

‎spec/amnesia/query_analyzer_spec.rb‎

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,9 @@
33
RSpec.describe Amnesia::QueryAnalyzer do
44
let(:instruction) { 'set' }
55
let(:key) { 'my:key' }
6+
let(:value) { 'value' }
67

7-
subject { described_class.call!(instruction, key, 'value') }
8+
subject { described_class.call!(instruction, key, value) }
89

910
describe '.call!' do
1011
context 'when a unknown instruction is given' do
@@ -31,6 +32,16 @@
3132
end
3233
end
3334

35+
context 'when command is SET' do
36+
context 'and a value is not supplied' do
37+
let(:value) { nil }
38+
39+
it 'raises a "set command must contain a key and a value" error' do
40+
expect { subject }.to raise_error(RuntimeError, 'set command must contain a key and a value')
41+
end
42+
end
43+
end
44+
3445
context 'when params are correctly passed' do
3546
it 'does not raise any error' do
3647
expect { subject }.not_to raise_error

‎spec/spec_helper.rb‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
1-
require 'amnesia'
1+
# require 'amnesia'
22
require 'amnesia/query_analyzer'
3+
require 'amnesia/query_parser'
34

45
RSpec.configure do |config|
56
# rspec-expectations config goes here. You can use an alternate

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /