diff options
Diffstat (limited to 'spec/mspec/spec/matchers/have_instance_variable_spec.rb')
-rw-r--r-- | spec/mspec/spec/matchers/have_instance_variable_spec.rb | 23 |
1 files changed, 6 insertions, 17 deletions
diff --git a/spec/mspec/spec/matchers/have_instance_variable_spec.rb b/spec/mspec/spec/matchers/have_instance_variable_spec.rb index ababb38bc7..4122c6551b 100644 --- a/spec/mspec/spec/matchers/have_instance_variable_spec.rb +++ b/spec/mspec/spec/matchers/have_instance_variable_spec.rb @@ -2,9 +2,12 @@ require 'spec_helper' require 'mspec/expectations/expectations' require 'mspec/matchers' -shared_examples_for "have_instance_variable, on all Ruby versions" do - after :all do - Object.const_set :RUBY_VERSION, @ruby_version +describe HaveInstanceVariableMatcher do + before :each do + @object = Object.new + def @object.instance_variables + [:@foo] + end end it "matches when object has the instance variable, given as string" do @@ -45,17 +48,3 @@ shared_examples_for "have_instance_variable, on all Ruby versions" do ] end end - -describe HaveInstanceVariableMatcher, "on RUBY_VERSION >= 1.9" do - before :all do - @ruby_version = Object.const_get :RUBY_VERSION - Object.const_set :RUBY_VERSION, '1.9.0' - - @object = Object.new - def @object.instance_variables - [:@foo] - end - end - - it_should_behave_like "have_instance_variable, on all Ruby versions" -end |