[rspec-devel] [ rspec-Feature Requests-7613 ] context#include should add constants into the context

noreply at rubyforge.org noreply at rubyforge.org
Wed Feb 7 23:11:22 EST 2007


Feature Requests item #7613, was opened at 2007-01-06 01:25
You can respond by visiting: 
http://rubyforge.org/tracker/?func=detail&atid=3152&aid=7613&group_id=797

Category: None
Group: None
Status: Open
Priority: 3
Submitted By: Brian Takita (btakita)
Assigned to: Nobody (None)
Summary: context#include should add constants into the context

Initial Comment:
dir = File.dirname(__FILE__)
require "#{dir}/spec_helper"

module Foo
  class Bar
  end
end

context "A Context include statement" do
  include Foo
  specify "should add constants accessable in the context" do
    b = Bar.new
  end
end


----------------------------------------------------------------------

>Comment By: David Chelimsky (dchelimsky)
Date: 2007-02-08 04:11

Message:
>From the ruby-talk list:

module TestHelper
 CONSTANT = "constant"
end

context "A context" do
 include TestHelper

 specify "should allow unqualified access to included constants" do
   CONSTANT.should_eql "constant"
   #fails
 end

 specify "should allow qualified access to all constants" do
   TestHelper::CONSTANT.should_eql "constant"
   # passes w/ fully qualified reference
 end
end

----------------------------------------------------------------------

You can respond by visiting: 
http://rubyforge.org/tracker/?func=detail&atid=3152&aid=7613&group_id=797


More information about the rspec-devel mailing list