Skip to content

Commit

Permalink
Merge commit 'cwninja/bugfixes'
Browse files Browse the repository at this point in the history
  • Loading branch information
qrush committed Jun 8, 2009
2 parents c17e4fe + acbbe7d commit 40568e7
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
2 changes: 1 addition & 1 deletion lib/shoulda/context.rb
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ module ClassMethods

def should(name, options = {}, &blk)
if Shoulda.current_context
block_given? ? Shoulda.current_context.should(name, options, &blk) : Should.current_context.should_eventually(name)
block_given? ? Shoulda.current_context.should(name, options, &blk) : Shoulda.current_context.should_eventually(name)
else
context_name = self.name.gsub(/Test/, "")
context = Shoulda::Context.new(context_name, self) do
Expand Down
5 changes: 5 additions & 0 deletions test/other/should_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@ def self.should_see_class_methods
end
end

def self.should_be_able_to_setup_a_should_eventually_in_a_class_method
should "be able to setup a should eventually in a class method"
end

def self.should_see_a_context_block_like_a_Test_Unit_class
should "see a context block as a Test::Unit class" do
assert_equal "ShouldTest", self.class.name
Expand Down Expand Up @@ -46,6 +50,7 @@ def self.should_be_able_to_make_context_macros(prefix = nil)
should_see_class_methods
should_see_a_context_block_like_a_Test_Unit_class
should_be_able_to_make_context_macros("Context ")
should_be_able_to_setup_a_should_eventually_in_a_class_method

should "not define @blah" do
assert ! self.instance_variables.include?("@blah")
Expand Down

0 comments on commit 40568e7

Please sign in to comment.