andyw8-seeing_is_believing 4.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.github/workflows/test.yml +60 -0
- data/.gitignore +19 -0
- data/.rspec +2 -0
- data/Gemfile +2 -0
- data/README.md +70 -0
- data/Rakefile +88 -0
- data/appveyor.yml +32 -0
- data/bin/seeing_is_believing +7 -0
- data/docs/example.gif +0 -0
- data/docs/frog-brown.png +0 -0
- data/docs/sib-streaming.gif +0 -0
- data/features/deprecated-flags.feature +91 -0
- data/features/errors.feature +155 -0
- data/features/examples.feature +423 -0
- data/features/flags.feature +852 -0
- data/features/regression.feature +898 -0
- data/features/support/env.rb +102 -0
- data/features/xmpfilter-style.feature +471 -0
- data/lib/seeing_is_believing/binary/align_chunk.rb +47 -0
- data/lib/seeing_is_believing/binary/align_file.rb +24 -0
- data/lib/seeing_is_believing/binary/align_line.rb +25 -0
- data/lib/seeing_is_believing/binary/annotate_end_of_file.rb +56 -0
- data/lib/seeing_is_believing/binary/annotate_every_line.rb +52 -0
- data/lib/seeing_is_believing/binary/annotate_marked_lines.rb +179 -0
- data/lib/seeing_is_believing/binary/comment_lines.rb +36 -0
- data/lib/seeing_is_believing/binary/commentable_lines.rb +126 -0
- data/lib/seeing_is_believing/binary/config.rb +455 -0
- data/lib/seeing_is_believing/binary/data_structures.rb +58 -0
- data/lib/seeing_is_believing/binary/engine.rb +161 -0
- data/lib/seeing_is_believing/binary/format_comment.rb +79 -0
- data/lib/seeing_is_believing/binary/interline_align.rb +57 -0
- data/lib/seeing_is_believing/binary/remove_annotations.rb +113 -0
- data/lib/seeing_is_believing/binary/rewrite_comments.rb +62 -0
- data/lib/seeing_is_believing/binary.rb +73 -0
- data/lib/seeing_is_believing/code.rb +139 -0
- data/lib/seeing_is_believing/compatibility.rb +28 -0
- data/lib/seeing_is_believing/debugger.rb +32 -0
- data/lib/seeing_is_believing/error.rb +17 -0
- data/lib/seeing_is_believing/evaluate_by_moving_files.rb +195 -0
- data/lib/seeing_is_believing/event_stream/consumer.rb +221 -0
- data/lib/seeing_is_believing/event_stream/events.rb +193 -0
- data/lib/seeing_is_believing/event_stream/handlers/debug.rb +61 -0
- data/lib/seeing_is_believing/event_stream/handlers/record_exit_events.rb +26 -0
- data/lib/seeing_is_believing/event_stream/handlers/stream_json_events.rb +23 -0
- data/lib/seeing_is_believing/event_stream/handlers/update_result.rb +41 -0
- data/lib/seeing_is_believing/event_stream/producer.rb +178 -0
- data/lib/seeing_is_believing/hard_core_ensure.rb +58 -0
- data/lib/seeing_is_believing/hash_struct.rb +206 -0
- data/lib/seeing_is_believing/result.rb +89 -0
- data/lib/seeing_is_believing/safe.rb +112 -0
- data/lib/seeing_is_believing/swap_files.rb +90 -0
- data/lib/seeing_is_believing/the_matrix.rb +97 -0
- data/lib/seeing_is_believing/version.rb +3 -0
- data/lib/seeing_is_believing/wrap_expressions.rb +265 -0
- data/lib/seeing_is_believing/wrap_expressions_with_inspect.rb +19 -0
- data/lib/seeing_is_believing.rb +69 -0
- data/seeing_is_believing.gemspec +84 -0
- data/spec/binary/alignment_specs.rb +27 -0
- data/spec/binary/comment_lines_spec.rb +852 -0
- data/spec/binary/config_spec.rb +831 -0
- data/spec/binary/engine_spec.rb +114 -0
- data/spec/binary/format_comment_spec.rb +210 -0
- data/spec/binary/marker_spec.rb +71 -0
- data/spec/binary/remove_annotations_spec.rb +342 -0
- data/spec/binary/rewrite_comments_spec.rb +106 -0
- data/spec/code_spec.rb +233 -0
- data/spec/debugger_spec.rb +45 -0
- data/spec/evaluate_by_moving_files_spec.rb +204 -0
- data/spec/event_stream_spec.rb +762 -0
- data/spec/hard_core_ensure_spec.rb +120 -0
- data/spec/hash_struct_spec.rb +514 -0
- data/spec/seeing_is_believing_spec.rb +1094 -0
- data/spec/sib_spec_helpers/version.rb +17 -0
- data/spec/spec_helper.rb +26 -0
- data/spec/spec_helper_spec.rb +16 -0
- data/spec/wrap_expressions_spec.rb +1013 -0
- metadata +340 -0
@@ -0,0 +1,17 @@
|
|
1
|
+
module SibSpecHelpers
|
2
|
+
class Version
|
3
|
+
attr_reader :segments
|
4
|
+
include Comparable
|
5
|
+
def initialize(version_string)
|
6
|
+
@segments = version_string.scan(/\d+/).map(&:to_i)
|
7
|
+
end
|
8
|
+
def <=>(other)
|
9
|
+
other = Version.new other unless other.kind_of? Version
|
10
|
+
segments.zip(other.segments).each do |ours, theirs|
|
11
|
+
return 1 if theirs.nil? || theirs < ours
|
12
|
+
return -1 if ours < theirs
|
13
|
+
end
|
14
|
+
segments.length <=> other.segments.length
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
data/spec/spec_helper.rb
ADDED
@@ -0,0 +1,26 @@
|
|
1
|
+
require 'sib_spec_helpers/version'
|
2
|
+
|
3
|
+
module SibSpecHelpers
|
4
|
+
def pending!(message="Not yet implemented")
|
5
|
+
pending message
|
6
|
+
raise message
|
7
|
+
end
|
8
|
+
|
9
|
+
def ruby_version
|
10
|
+
Version.new RUBY_VERSION
|
11
|
+
end
|
12
|
+
end
|
13
|
+
|
14
|
+
RSpec.configure do |c|
|
15
|
+
c.disable_monkey_patching!
|
16
|
+
c.include SibSpecHelpers
|
17
|
+
c.filter_run_excluding :not_implemented
|
18
|
+
|
19
|
+
if RSpec::Support::OS.windows? || RSpec::Support::Ruby.jruby?
|
20
|
+
c.before(needs_fork: true) { skip 'Fork is not available on this system' }
|
21
|
+
end
|
22
|
+
|
23
|
+
if RSpec::Support::OS.windows?
|
24
|
+
c.before(windows: false) { skip "This either doesn't work or I can't figure out how to test it on Windows" }
|
25
|
+
end
|
26
|
+
end
|
@@ -0,0 +1,16 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
RSpec.describe SibSpecHelpers::Version do
|
4
|
+
let(:v231) { SibSpecHelpers::Version.new '2.3.1' }
|
5
|
+
example { expect(v231).to eq v231 }
|
6
|
+
example { expect(v231).to eq '2.3.1' }
|
7
|
+
example { expect(v231).to_not be < '2' }
|
8
|
+
example { expect(v231).to be < '3' }
|
9
|
+
example { expect(v231).to_not be < '2.2' }
|
10
|
+
example { expect(v231).to_not be < '2.3' }
|
11
|
+
example { expect(v231).to be < '2.4' }
|
12
|
+
example { expect(v231).to_not be < '2.3.0' }
|
13
|
+
example { expect(v231).to_not be < '2.3.1' }
|
14
|
+
example { expect(v231).to be < '2.3.2' }
|
15
|
+
example { expect(v231).to be < '2.3.1.0' }
|
16
|
+
end
|