File tree Expand file tree Collapse file tree 4 files changed +4
-31
lines changed Expand file tree Collapse file tree 4 files changed +4
-31
lines changed Original file line number Diff line number Diff line change @@ -28,7 +28,6 @@ def stream(stream_name)
28
28
# @return [Specification]
29
29
def from ( start )
30
30
raise InvalidPageStart if start . nil? || start . empty?
31
- raise EventNotFound . new ( start ) unless reader . has_event? ( start )
32
31
Specification . new ( reader , result . dup { |r | r . start = start } )
33
32
end
34
33
@@ -39,7 +38,6 @@ def from(start)
39
38
# @return [Specification]
40
39
def to ( stop )
41
40
raise InvalidPageStop if stop . nil? || stop . empty?
42
- raise EventNotFound . new ( stop ) unless reader . has_event? ( stop )
43
41
Specification . new ( reader , result . dup { |r | r . stop = stop } )
44
42
end
45
43
Original file line number Diff line number Diff line change @@ -29,12 +29,6 @@ def count(specification_result)
29
29
repository . count ( specification_result )
30
30
end
31
31
32
- # @api private
33
- # @private
34
- def has_event? ( event_id )
35
- repository . has_event? ( event_id )
36
- end
37
-
38
32
private
39
33
40
34
attr_reader :repository , :mapper
Original file line number Diff line number Diff line change @@ -341,19 +341,6 @@ module RubyEventStore
341
341
expect { client . read . backward . stream ( "" ) . limit ( 100 ) . to_a } . to raise_error ( IncorrectStreamData )
342
342
end
343
343
344
- specify "raise exception if event_id does not exist" do
345
- expect { client . read . stream ( "stream_name" ) . from ( "0" ) . limit ( 100 ) . to_a } . to raise_error (
346
- EventNotFound ,
347
- /Event not found: 0/
348
- )
349
- expect { client . read . backward . stream ( "stream_name" ) . from ( "0" ) . limit ( 100 ) . to_a } . to raise_error ( EventNotFound , /0/ )
350
- end
351
-
352
- specify "raise exception if event_id is not given or invalid" do
353
- expect { client . read . stream ( "stream_name" ) . from ( nil ) . limit ( 100 ) . to_a } . to raise_error ( InvalidPageStart )
354
- expect { client . read . backward . stream ( "stream_name" ) . from ( :invalid ) . limit ( 100 ) . to_a } . to raise_error ( EventNotFound )
355
- end
356
-
357
344
specify "fails when page size is invalid" do
358
345
expect { client . read . stream ( "stream_name" ) . limit ( 0 ) . to_a } . to raise_error ( InvalidPageSize )
359
346
expect { client . read . backward . stream ( "stream_name" ) . limit ( 0 ) . to_a } . to raise_error ( InvalidPageSize )
@@ -410,9 +397,11 @@ module RubyEventStore
410
397
client . publish ( event , stream_name : "stream_name" )
411
398
end
412
399
413
- expect { client . read . stream ( "stream_name" ) . from ( SecureRandom . uuid ) . limit ( 100 ) . to_a } . to raise_error ( EventNotFound )
400
+ expect { client . read . stream ( "stream_name" ) . from ( SecureRandom . uuid ) . limit ( 100 ) . to_a } . to raise_error (
401
+ EventNotFoundInStream
402
+ )
414
403
expect { client . read . backward . stream ( "stream_name" ) . from ( SecureRandom . uuid ) . limit ( 100 ) . to_a } . to raise_error (
415
- EventNotFound
404
+ EventNotFoundInStream
416
405
)
417
406
end
418
407
Original file line number Diff line number Diff line change @@ -38,21 +38,13 @@ module RubyEventStore
38
38
39
39
specify { expect { specification . from ( nil ) } . to raise_error ( InvalidPageStart ) }
40
40
specify { expect { specification . from ( "" ) } . to raise_error ( InvalidPageStart ) }
41
- specify { expect { specification . from ( :dummy ) } . to raise_error ( EventNotFound , /dummy/ ) }
42
- specify { expect { specification . from ( none_such_id ) } . to raise_error ( EventNotFound , /#{ none_such_id } / ) }
43
41
specify do
44
42
repository . append_to_stream ( [ test_record ( event_id ) ] , Stream . new ( "Dummy" ) , ExpectedVersion . none )
45
43
expect { specification . stream ( 'Another' ) . from ( event_id ) } . not_to raise_error
46
44
end
47
45
48
46
specify { expect { specification . to ( nil ) } . to raise_error ( InvalidPageStop ) }
49
47
specify { expect { specification . to ( "" ) } . to raise_error ( InvalidPageStop ) }
50
- specify { expect { specification . to ( :dummy ) } . to raise_error ( EventNotFound , /dummy/ ) }
51
- specify { expect { specification . to ( none_such_id ) } . to raise_error ( EventNotFound , /#{ none_such_id } / ) }
52
- specify do
53
- repository . append_to_stream ( [ test_record ( event_id ) ] , Stream . new ( "Dummy" ) , ExpectedVersion . none )
54
- expect { specification . stream ( 'Another' ) . to ( event_id ) } . not_to raise_error
55
- end
56
48
57
49
specify { expect { specification . older_than ( nil ) } . to raise_error ( ArgumentError ) }
58
50
specify { expect { specification . older_than ( "" ) } . to raise_error ( ArgumentError ) }
You can’t perform that action at this time.
0 commit comments