summaryrefslogtreecommitdiff
path: root/spec/mspec/lib/mspec/matchers/have_instance_variable.rb
diff options
context:
space:
mode:
Diffstat (limited to 'spec/mspec/lib/mspec/matchers/have_instance_variable.rb')
-rw-r--r--spec/mspec/lib/mspec/matchers/have_instance_variable.rb12
1 files changed, 12 insertions, 0 deletions
diff --git a/spec/mspec/lib/mspec/matchers/have_instance_variable.rb b/spec/mspec/lib/mspec/matchers/have_instance_variable.rb
new file mode 100644
index 0000000000..e83eb9408c
--- /dev/null
+++ b/spec/mspec/lib/mspec/matchers/have_instance_variable.rb
@@ -0,0 +1,12 @@
+require 'mspec/matchers/variable'
+
+class HaveInstanceVariableMatcher < VariableMatcher
+ self.variables_method = :instance_variables
+ self.description = 'instance variable'
+end
+
+class Object
+ def have_instance_variable(variable)
+ HaveInstanceVariableMatcher.new(variable)
+ end
+end \ No newline at end of file