-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
381fd9d
commit d6352f2
Showing
3 changed files
with
35 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
class AliasMethodSpec | ||
def foo; 'foo'; end | ||
alias_method :bar, :foo | ||
end | ||
|
||
describe "Module#alias_method" do | ||
it "makes a copy of the method" do | ||
AliasMethodSpec.new.bar.should == 'foo' | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
module ModuleAncestorsSpec | ||
class A; end | ||
class B < A; end | ||
end | ||
|
||
describe "Module#ancestors" do | ||
it "returns a list of modules in self (including self)" do | ||
ModuleAncestorsSpec::B.ancestors.include?(ModuleAncestorsSpec::B).should == true | ||
ModuleAncestorsSpec::B.ancestors.include?(ModuleAncestorsSpec::A).should == true | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
module AppendFeaturesSpec | ||
class Klass; end | ||
|
||
def self.append_features(mod) | ||
ScratchPad.record mod | ||
end | ||
end | ||
|
||
describe "Module#append_features" do | ||
it "gets called when self is included in another module/class" do | ||
AppendFeaturesSpec::Klass.include AppendFeaturesSpec | ||
ScratchPad.recorded.should == AppendFeaturesSpec::Klass | ||
end | ||
end |