From 49a864ad902c7e819f2464f1001e9719a9af6cb5 Mon Sep 17 00:00:00 2001 From: eregon Date: Thu, 14 Sep 2017 15:56:09 +0000 Subject: Update to ruby/mspec@5bd9409 git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59909 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- .../spec/matchers/have_class_variable_spec.rb | 23 +++++----------------- 1 file changed, 5 insertions(+), 18 deletions(-) (limited to 'spec/mspec/spec/matchers/have_class_variable_spec.rb') diff --git a/spec/mspec/spec/matchers/have_class_variable_spec.rb b/spec/mspec/spec/matchers/have_class_variable_spec.rb index e440050056..01ba9d0f57 100644 --- a/spec/mspec/spec/matchers/have_class_variable_spec.rb +++ b/spec/mspec/spec/matchers/have_class_variable_spec.rb @@ -2,13 +2,13 @@ require 'spec_helper' require 'mspec/expectations/expectations' require 'mspec/matchers' -class IVarModMock; end - -shared_examples_for "have_class_variable, on all Ruby versions" do - after :all do - Object.const_set :RUBY_VERSION, @ruby_version +class IVarModMock + def self.class_variables + [:@foo] end +end +describe HaveClassVariableMatcher, "on RUBY_VERSION >= 1.9" do it "matches when mod has the class variable, given as string" do matcher = HaveClassVariableMatcher.new('@foo') matcher.matches?(IVarModMock).should be_true @@ -47,16 +47,3 @@ shared_examples_for "have_class_variable, on all Ruby versions" do ] end end - -describe HaveClassVariableMatcher, "on RUBY_VERSION >= 1.9" do - before :all do - @ruby_version = Object.const_get :RUBY_VERSION - Object.const_set :RUBY_VERSION, '1.9.0' - - def IVarModMock.class_variables - [:@foo] - end - end - - it_should_behave_like "have_class_variable, on all Ruby versions" -end -- cgit v1.2.3