Skip to content

Commit 026d321

Browse files
Earlopaineregon
authored andcommitted
Move Pathname to rely less on shared examples
Also add one alias test
1 parent c871c7c commit 026d321

4 files changed

Lines changed: 17 additions & 12 deletions

File tree

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
require_relative '../../spec_helper'
2+
require 'pathname'
3+
4+
describe "Pathname#===" do
5+
it "is an alias of Pathname#==" do
6+
Pathname.instance_method(:===).should == Pathname.instance_method(:==)
7+
end
8+
end

library/pathname/divide_spec.rb

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
require_relative '../../spec_helper'
2-
require_relative 'shared/plus'
2+
require 'pathname'
33

44
describe "Pathname#/" do
5-
it_behaves_like :pathname_plus, :/
5+
it "is an alias of Pathname#+" do
6+
Pathname.instance_method(:/).should == Pathname.instance_method(:+)
7+
end
68
end

library/pathname/plus_spec.rb

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
require_relative '../../spec_helper'
2-
require_relative 'shared/plus'
2+
require 'pathname'
33

44
describe "Pathname#+" do
5-
it_behaves_like :pathname_plus, :+
5+
it "appends a pathname to self" do
6+
p = Pathname.new("/usr")
7+
(p + "bin/ruby").should == Pathname.new("/usr/bin/ruby")
8+
end
69
end

library/pathname/shared/plus.rb

Lines changed: 0 additions & 8 deletions
This file was deleted.

0 commit comments

Comments
 (0)