Skip to content

Commit 68f93ee

Browse files
committed
Reformat failures
Recreate the structure of objects and display a diff in the case of failure instead of showing a breakdown of which elements were inserted or deleted.
1 parent 41621ab commit 68f93ee

File tree

9 files changed

+771
-235
lines changed

9 files changed

+771
-235
lines changed

Gemfile

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,10 @@ source "https://rubygems.org"
55
git_source(:github) { |repo_name| "https://github.com/#{repo_name}" }
66

77
gem "rubocop"
8-
gem "rspec"
8+
gem "rspec-core", github: "rspec/rspec-core"
9+
gem "rspec-support", github: "rspec/rspec-support"
10+
gem "rspec-expectations", github: "rspec/rspec-expectations"
11+
gem "rspec-mocks", github: "rspec/rspec-mocks"
912
gem "pry-byebug"
1013

1114
gemspec

Gemfile.lock

Lines changed: 33 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,32 @@
1+
GIT
2+
remote: https://github.com/rspec/rspec-core
3+
revision: 96450f8468baf601b9e5c00c08bcac18013426ff
4+
specs:
5+
rspec-core (3.9.0.pre)
6+
rspec-support (= 3.9.0.pre)
7+
8+
GIT
9+
remote: https://github.com/rspec/rspec-expectations
10+
revision: 31f108eae68e31ee65f0622c9ef4a488a1602943
11+
specs:
12+
rspec-expectations (3.9.0.pre)
13+
diff-lcs (>= 1.2.0, < 2.0)
14+
rspec-support (= 3.9.0.pre)
15+
16+
GIT
17+
remote: https://github.com/rspec/rspec-mocks
18+
revision: 8ee8d692885ea2d4713c01d0ee6ba3ef2a3251c9
19+
specs:
20+
rspec-mocks (3.9.0.pre)
21+
diff-lcs (>= 1.2.0, < 2.0)
22+
rspec-support (= 3.9.0.pre)
23+
24+
GIT
25+
remote: https://github.com/rspec/rspec-support
26+
revision: 9940a8656071655b807f772f36101b4d27f1b67d
27+
specs:
28+
rspec-support (3.9.0.pre)
29+
130
PATH
231
remote: .
332
specs:
@@ -26,19 +55,6 @@ GEM
2655
byebug (~> 10.0)
2756
pry (~> 0.10)
2857
rainbow (3.0.0)
29-
rspec (3.8.0)
30-
rspec-core (~> 3.8.0)
31-
rspec-expectations (~> 3.8.0)
32-
rspec-mocks (~> 3.8.0)
33-
rspec-core (3.8.0)
34-
rspec-support (~> 3.8.0)
35-
rspec-expectations (3.8.1)
36-
diff-lcs (>= 1.2.0, < 2.0)
37-
rspec-support (~> 3.8.0)
38-
rspec-mocks (3.8.0)
39-
diff-lcs (>= 1.2.0, < 2.0)
40-
rspec-support (~> 3.8.0)
41-
rspec-support (3.8.0)
4258
rubocop (0.58.2)
4359
jaro_winkler (~> 1.5.1)
4460
parallel (~> 1.10)
@@ -56,7 +72,10 @@ PLATFORMS
5672

5773
DEPENDENCIES
5874
pry-byebug
59-
rspec
75+
rspec-core!
76+
rspec-expectations!
77+
rspec-mocks!
78+
rspec-support!
6079
rubocop
6180
super_diff!
6281

lib/super_diff/csi/color_helper.rb

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,14 @@ module ColorHelper
55
# LIGHT_RED = Csi::TwentyFourBitColor.new(r: 63, g: 32, b: 32)
66
LIGHT_RED = Csi::TwentyFourBitColor.new(r: 73, g: 62, b: 71)
77
# RED = Csi::TwentyFourBitColor.new(r: 110, g: 56, b: 56)
8-
RED = Csi::TwentyFourBitColor.new(r: 116, g: 78, b: 84)
8+
# RED = Csi::TwentyFourBitColor.new(r: 116, g: 78, b: 84)
9+
RED = Csi::FourBitColor.new(:red)
910
# LIGHT_GREEN = Csi::TwentyFourBitColor.new(r: 40, g: 48, b: 39)
1011
LIGHT_GREEN = Csi::TwentyFourBitColor.new(r: 51, g: 81, b: 81)
1112
# GREEN = Csi::TwentyFourBitColor.new(r: 73, g: 87, b: 71)
12-
GREEN = Csi::TwentyFourBitColor.new(r: 81, g: 115, b: 105)
13+
# GREEN = Csi::TwentyFourBitColor.new(r: 81, g: 115, b: 105)
14+
GREEN = Csi::FourBitColor.new(:green)
15+
DARK_GREY = Csi::TwentyFourBitColor.new(r: 134, g: 147, b: 149)
1316

1417
def self.plain(text)
1518
text
@@ -29,16 +32,20 @@ def self.light_red_bg(text)
2932
Csi.colorize(text, fg: BLACK, bg: LIGHT_RED)
3033
end
3134

32-
def self.red_bg(text)
33-
Csi.colorize(text, fg: BLACK, bg: RED)
35+
def self.red(text)
36+
Csi.colorize(text, fg: RED)
3437
end
3538

3639
def self.light_green_bg(text)
3740
Csi.colorize(text, fg: BLACK, bg: LIGHT_GREEN)
3841
end
3942

40-
def self.green_bg(text)
41-
Csi.colorize(text, fg: BLACK, bg: GREEN)
43+
def self.green(text)
44+
Csi.colorize(text, fg: GREEN)
45+
end
46+
47+
def self.dark_grey(text)
48+
Csi.colorize(text, fg: BLACK, bg: DARK_GREY)
4249
end
4350
end
4451
end

0 commit comments

Comments
 (0)