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
Showing
8 changed files
with
158 additions
and
8 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
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,16 @@ | ||
require_relative '../../spec_helper' | ||
|
||
describe "GC.stat" do | ||
it "supports access by key" do | ||
keys = [:heap_free_slots, :total_allocated_objects, :count] | ||
keys.each do |key| | ||
GC.stat(key).should be_kind_of(Integer) | ||
end | ||
end | ||
|
||
it "returns hash of values" do | ||
stat = GC.stat | ||
stat.should be_kind_of(Hash) | ||
stat.keys.should include(:count) | ||
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
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
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,30 @@ | ||
require_relative '../../../spec_helper' | ||
require 'rubygems' | ||
|
||
describe "Gem.bin_path" do | ||
before :each do | ||
@bundle_gemfile = ENV['BUNDLE_GEMFILE'] | ||
ENV['BUNDLE_GEMFILE'] = tmp("no-gemfile") | ||
end | ||
|
||
after :each do | ||
ENV['BUNDLE_GEMFILE'] = @bundle_gemfile | ||
end | ||
|
||
it "finds executables of default gems, which are the only files shipped for default gems" do | ||
# For instance, Gem.bin_path("bundler", "bundle") is used by rails new | ||
|
||
if Gem.respond_to? :default_specifications_dir | ||
default_specifications_dir = Gem.default_specifications_dir | ||
else | ||
default_specifications_dir = Gem::Specification.default_specifications_dir | ||
end | ||
|
||
Gem::Specification.each_spec([default_specifications_dir]) do |spec| | ||
spec.executables.each do |exe| | ||
path = Gem.bin_path(spec.name, exe) | ||
File.exist?(path).should == true | ||
end | ||
end | ||
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
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
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