Skip to content

Commit 5fd9a66

Browse files
authored
Merge pull request #3 from apepper/newer_dependencies
Newer dependencies
2 parents db40217 + 50e6924 commit 5fd9a66

File tree

5 files changed

+23
-20
lines changed

5 files changed

+23
-20
lines changed

.travis.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
language: ruby
2+
sudo: false
3+
cache: bundler
24
rvm:
3-
- 2.0.0
5+
- 2.1.10
46
script: bundle exec rspec

Gemfile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,5 @@ gemspec
55
gem "pry"
66
gem "yard"
77
gem "redcarpet"
8+
gem "rspec", "~> 3.5.0"
9+
gem "rake", "~> 12.0"

hyp_diff.gemspec

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,6 @@ HypDiff compares HTML snippets. It generates a diff between two input snippets.
2020
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
2121
spec.require_paths = ["lib"]
2222

23-
spec.add_dependency "nokogiri", "~> 1.6.5"
24-
spec.add_dependency "diff-lcs", "~> 1.2.5"
25-
26-
spec.add_development_dependency "bundler", "~> 1.5"
27-
spec.add_development_dependency "rspec", "~> 2.14.1"
28-
spec.add_development_dependency "rake", "~> 10.1"
23+
spec.add_dependency "nokogiri", "~> 1.6", ">= 1.6.5"
24+
spec.add_dependency "diff-lcs", "~> 1.2", ">= 1.2.5"
2925
end

spec/hyp_diff_spec.rb

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
describe HypDiff do
55

66
def expect_diff(old, new, expected)
7-
HypDiff.compare(old, new).should == expected
7+
expect(HypDiff.compare(old, new)).to eq(expected)
88
end
99

1010
it "diffs two texts, applying tags to indicate changes" do
@@ -69,33 +69,36 @@ def expect_diff(old, new, expected)
6969

7070
describe "with callbacks for custom markup" do
7171
it "uses them to generate the insertions and deletions" do
72-
HypDiff.compare(
72+
expect(HypDiff.compare(
7373
"byebye world",
7474
"hello world",
7575
render_insertion: proc { |html| "<new>#{html}</new>" },
7676
render_deletion: proc { |html| "<old>#{html}</old>" }
77-
).should ==
77+
)).to eq(
7878
"<old>byebye</old><new>hello</new> world"
79+
)
7980
end
8081
end
8182

8283
describe "choosing which markup to use" do
8384
it "allows to choose 'after'" do
84-
HypDiff.compare(
85+
expect(HypDiff.compare(
8586
"<b>byebye world</b>",
8687
"<i>hello world</i>",
8788
markup_from: "after"
88-
).should ==
89+
)).to eq(
8990
"<i><del>byebye</del><ins>hello</ins> world</i>"
91+
)
9092
end
9193

9294
it "allows to choose 'before'" do
93-
HypDiff.compare(
95+
expect(HypDiff.compare(
9496
"<b>byebye world</b>",
9597
"<i>hello world</i>",
9698
markup_from: "before"
97-
).should ==
99+
)).to eq(
98100
"<b><del>byebye</del><ins>hello</ins> world</b>"
101+
)
99102
end
100103
end
101104

spec/text_from_node_spec.rb

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,16 +12,16 @@ module HypDiff
1212
let(:other_text_same_node) { TextFromNode.new("eggs", node) }
1313

1414
it "equals other instance when text is equal" do
15-
subject.should == same_text_other_node
16-
subject.should be_eql(same_text_other_node)
15+
expect(subject).to eq(same_text_other_node)
16+
expect(subject).to be_eql(same_text_other_node)
1717

18-
subject.should_not == other_text_same_node
19-
subject.should_not be_eql(other_text_same_node)
18+
expect(subject).not_to eq(other_text_same_node)
19+
expect(subject).not_to be_eql(other_text_same_node)
2020
end
2121

2222
it "provides a sane hash implementation" do
23-
subject.hash.should == same_text_other_node.hash
24-
subject.hash.should_not == other_text_same_node.hash
23+
expect(subject.hash).to eq(same_text_other_node.hash)
24+
expect(subject.hash).not_to eq(other_text_same_node.hash)
2525
end
2626

2727
end

0 commit comments

Comments
 (0)