diff options
Diffstat (limited to 'spec/ruby/core/env')
-rw-r--r-- | spec/ruby/core/env/each_pair_spec.rb | 2 | ||||
-rw-r--r-- | spec/ruby/core/env/each_spec.rb | 2 | ||||
-rw-r--r-- | spec/ruby/core/env/element_set_spec.rb | 2 | ||||
-rw-r--r-- | spec/ruby/core/env/fetch_spec.rb | 5 | ||||
-rw-r--r-- | spec/ruby/core/env/has_key_spec.rb | 2 | ||||
-rw-r--r-- | spec/ruby/core/env/has_value_spec.rb | 2 | ||||
-rw-r--r-- | spec/ruby/core/env/include_spec.rb | 2 | ||||
-rw-r--r-- | spec/ruby/core/env/index_spec.rb | 2 | ||||
-rw-r--r-- | spec/ruby/core/env/key_spec.rb | 4 | ||||
-rw-r--r-- | spec/ruby/core/env/length_spec.rb | 2 | ||||
-rw-r--r-- | spec/ruby/core/env/member_spec.rb | 2 | ||||
-rw-r--r-- | spec/ruby/core/env/size_spec.rb | 2 | ||||
-rw-r--r-- | spec/ruby/core/env/store_spec.rb | 2 | ||||
-rw-r--r-- | spec/ruby/core/env/to_h_spec.rb | 2 | ||||
-rw-r--r-- | spec/ruby/core/env/to_hash_spec.rb | 2 | ||||
-rw-r--r-- | spec/ruby/core/env/value_spec.rb | 2 |
16 files changed, 19 insertions, 18 deletions
diff --git a/spec/ruby/core/env/each_pair_spec.rb b/spec/ruby/core/env/each_pair_spec.rb index 255ccd86c5..063d943aff 100644 --- a/spec/ruby/core/env/each_pair_spec.rb +++ b/spec/ruby/core/env/each_pair_spec.rb @@ -2,5 +2,5 @@ require File.expand_path('../../../spec_helper', __FILE__) require File.expand_path('../shared/each.rb', __FILE__) describe "ENV.each_pair" do - it_behaves_like(:env_each, :each_pair) + it_behaves_like :env_each, :each_pair end diff --git a/spec/ruby/core/env/each_spec.rb b/spec/ruby/core/env/each_spec.rb index 2424c5e4e0..e930cf4ab9 100644 --- a/spec/ruby/core/env/each_spec.rb +++ b/spec/ruby/core/env/each_spec.rb @@ -2,5 +2,5 @@ require File.expand_path('../../../spec_helper', __FILE__) require File.expand_path('../shared/each.rb', __FILE__) describe "ENV.each" do - it_behaves_like(:env_each, :each) + it_behaves_like :env_each, :each end diff --git a/spec/ruby/core/env/element_set_spec.rb b/spec/ruby/core/env/element_set_spec.rb index a80cd0c51e..45eed4b025 100644 --- a/spec/ruby/core/env/element_set_spec.rb +++ b/spec/ruby/core/env/element_set_spec.rb @@ -2,5 +2,5 @@ require File.expand_path('../../../spec_helper', __FILE__) require File.expand_path('../shared/store.rb', __FILE__) describe "ENV.[]=" do - it_behaves_like(:env_store, :[]=) + it_behaves_like :env_store, :[]= end diff --git a/spec/ruby/core/env/fetch_spec.rb b/spec/ruby/core/env/fetch_spec.rb index 708ee91c39..cc74e32da3 100644 --- a/spec/ruby/core/env/fetch_spec.rb +++ b/spec/ruby/core/env/fetch_spec.rb @@ -1,4 +1,5 @@ require File.expand_path('../../../spec_helper', __FILE__) +require File.expand_path('../../../shared/hash/key_error', __FILE__) describe "ENV.fetch" do it "returns a value" do @@ -11,8 +12,8 @@ describe "ENV.fetch" do lambda { ENV.fetch :should_never_be_set }.should raise_error(TypeError) end - it "raises a KeyError if the key is not found" do - lambda { ENV.fetch "should_never_be_set" }.should raise_error(KeyError) + context "when the key is not found" do + it_behaves_like :key_error, ->(obj, key) { obj.fetch(key) }, ENV end it "provides the given default parameter" do diff --git a/spec/ruby/core/env/has_key_spec.rb b/spec/ruby/core/env/has_key_spec.rb index 8da2d94265..3cd1adbd2d 100644 --- a/spec/ruby/core/env/has_key_spec.rb +++ b/spec/ruby/core/env/has_key_spec.rb @@ -2,5 +2,5 @@ require File.expand_path('../../../spec_helper', __FILE__) require File.expand_path('../shared/include.rb', __FILE__) describe "ENV.has_key?" do - it_behaves_like(:env_include, :has_key?) + it_behaves_like :env_include, :has_key? end diff --git a/spec/ruby/core/env/has_value_spec.rb b/spec/ruby/core/env/has_value_spec.rb index 76980a8df4..bb8c107387 100644 --- a/spec/ruby/core/env/has_value_spec.rb +++ b/spec/ruby/core/env/has_value_spec.rb @@ -2,5 +2,5 @@ require File.expand_path('../../../spec_helper', __FILE__) require File.expand_path('../shared/value.rb', __FILE__) describe "ENV.has_value?" do - it_behaves_like(:env_value, :has_value?) + it_behaves_like :env_value, :has_value? end diff --git a/spec/ruby/core/env/include_spec.rb b/spec/ruby/core/env/include_spec.rb index 4a716fee85..2c366a1d45 100644 --- a/spec/ruby/core/env/include_spec.rb +++ b/spec/ruby/core/env/include_spec.rb @@ -2,5 +2,5 @@ require File.expand_path('../../../spec_helper', __FILE__) require File.expand_path('../shared/include.rb', __FILE__) describe "ENV.include?" do - it_behaves_like(:env_include, :include?) + it_behaves_like :env_include, :include? end diff --git a/spec/ruby/core/env/index_spec.rb b/spec/ruby/core/env/index_spec.rb index 95009b3558..7fd325fc02 100644 --- a/spec/ruby/core/env/index_spec.rb +++ b/spec/ruby/core/env/index_spec.rb @@ -2,5 +2,5 @@ require File.expand_path('../../../spec_helper', __FILE__) require File.expand_path('../shared/key.rb', __FILE__) describe "ENV.index" do - it_behaves_like(:env_key, :index) + it_behaves_like :env_key, :index end diff --git a/spec/ruby/core/env/key_spec.rb b/spec/ruby/core/env/key_spec.rb index b653b1b1a5..3f887a5fc5 100644 --- a/spec/ruby/core/env/key_spec.rb +++ b/spec/ruby/core/env/key_spec.rb @@ -3,9 +3,9 @@ require File.expand_path('../shared/include.rb', __FILE__) require File.expand_path('../shared/key.rb', __FILE__) describe "ENV.key?" do - it_behaves_like(:env_include, :key?) + it_behaves_like :env_include, :key? end describe "ENV.key" do - it_behaves_like(:env_key, :key) + it_behaves_like :env_key, :key end diff --git a/spec/ruby/core/env/length_spec.rb b/spec/ruby/core/env/length_spec.rb index 83d1b58c74..37b98b3f0d 100644 --- a/spec/ruby/core/env/length_spec.rb +++ b/spec/ruby/core/env/length_spec.rb @@ -2,5 +2,5 @@ require File.expand_path('../../../spec_helper', __FILE__) require File.expand_path('../shared/length.rb', __FILE__) describe "ENV.length" do - it_behaves_like(:env_length, :length) + it_behaves_like :env_length, :length end diff --git a/spec/ruby/core/env/member_spec.rb b/spec/ruby/core/env/member_spec.rb index 25aa71e973..c0f06c70df 100644 --- a/spec/ruby/core/env/member_spec.rb +++ b/spec/ruby/core/env/member_spec.rb @@ -2,5 +2,5 @@ require File.expand_path('../../../spec_helper', __FILE__) require File.expand_path('../shared/include.rb', __FILE__) describe "ENV.member?" do - it_behaves_like(:env_include, :member?) + it_behaves_like :env_include, :member? end diff --git a/spec/ruby/core/env/size_spec.rb b/spec/ruby/core/env/size_spec.rb index 882ceac485..466f03fecc 100644 --- a/spec/ruby/core/env/size_spec.rb +++ b/spec/ruby/core/env/size_spec.rb @@ -2,5 +2,5 @@ require File.expand_path('../../../spec_helper', __FILE__) require File.expand_path('../shared/length.rb', __FILE__) describe "ENV.size" do - it_behaves_like(:env_length, :size) + it_behaves_like :env_length, :size end diff --git a/spec/ruby/core/env/store_spec.rb b/spec/ruby/core/env/store_spec.rb index 1ee5ce020e..af4be3a525 100644 --- a/spec/ruby/core/env/store_spec.rb +++ b/spec/ruby/core/env/store_spec.rb @@ -2,5 +2,5 @@ require File.expand_path('../../../spec_helper', __FILE__) require File.expand_path('../shared/store.rb', __FILE__) describe "ENV.store" do - it_behaves_like(:env_store, :store) + it_behaves_like :env_store, :store end diff --git a/spec/ruby/core/env/to_h_spec.rb b/spec/ruby/core/env/to_h_spec.rb index d0fef5382b..0c65700782 100644 --- a/spec/ruby/core/env/to_h_spec.rb +++ b/spec/ruby/core/env/to_h_spec.rb @@ -2,5 +2,5 @@ require File.expand_path('../../../spec_helper', __FILE__) require File.expand_path('../shared/to_hash.rb', __FILE__) describe "ENV.to_hash" do - it_behaves_like(:env_to_hash, :to_h) + it_behaves_like :env_to_hash, :to_h end diff --git a/spec/ruby/core/env/to_hash_spec.rb b/spec/ruby/core/env/to_hash_spec.rb index 3362fa9307..1d923990e1 100644 --- a/spec/ruby/core/env/to_hash_spec.rb +++ b/spec/ruby/core/env/to_hash_spec.rb @@ -2,5 +2,5 @@ require File.expand_path('../../../spec_helper', __FILE__) require File.expand_path('../shared/to_hash.rb', __FILE__) describe "ENV.to_hash" do - it_behaves_like(:env_to_hash, :to_hash) + it_behaves_like :env_to_hash, :to_hash end diff --git a/spec/ruby/core/env/value_spec.rb b/spec/ruby/core/env/value_spec.rb index c7eb7c5376..44e7c73d4f 100644 --- a/spec/ruby/core/env/value_spec.rb +++ b/spec/ruby/core/env/value_spec.rb @@ -2,5 +2,5 @@ require File.expand_path('../../../spec_helper', __FILE__) require File.expand_path('../shared/value.rb', __FILE__) describe "ENV.value?" do - it_behaves_like(:env_value, :value?) + it_behaves_like :env_value, :value? end |