diff options
author | Benoit Daloze <[email protected]> | 2020-06-27 15:51:37 +0200 |
---|---|---|
committer | Benoit Daloze <[email protected]> | 2020-06-27 15:51:37 +0200 |
commit | b3fa158d1c4d8e03b8dc04f1e4f9940a8a4ef44c (patch) | |
tree | fa8a62d6192c24a21e70aa02589507adfe4e4e6a /spec/ruby/core/symbol | |
parent | 64d8c0815e6ab042e8a67a670bda9f34404fa662 (diff) |
Update to ruby/spec@b6b7752
Diffstat (limited to 'spec/ruby/core/symbol')
-rw-r--r-- | spec/ruby/core/symbol/all_symbols_spec.rb | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/spec/ruby/core/symbol/all_symbols_spec.rb b/spec/ruby/core/symbol/all_symbols_spec.rb index ef2b4f85e6..1e21809093 100644 --- a/spec/ruby/core/symbol/all_symbols_spec.rb +++ b/spec/ruby/core/symbol/all_symbols_spec.rb @@ -1,14 +1,19 @@ require_relative '../../spec_helper' describe "Symbol.all_symbols" do - it "returns an array containing all the Symbols in the symbol table" do + it "returns an array of Symbols" do all_symbols = Symbol.all_symbols all_symbols.should be_an_instance_of(Array) - all_symbols.all? { |s| s.is_a?(Symbol) ? true : (p s; false) }.should == true + all_symbols.each { |s| s.should be_an_instance_of(Symbol) } end - it "returns an Array containing Symbols that have been created" do + it "includes symbols that are strongly referenced" do symbol = "symbol_specs_#{rand(5_000_000)}".to_sym Symbol.all_symbols.should include(symbol) end + + it "includes symbols that are referenced in source code but not yet executed" do + Symbol.all_symbols.any? { |s| s.to_s == 'symbol_specs_referenced_in_source_code' }.should be_true + :symbol_specs_referenced_in_source_code + end end |