Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

Fix 1.8 DSL#name bug. #251

Closed
wants to merge 1 commit into
from

Conversation

Projects
None yet
2 participants

As mentioned in issue #28, the DSL usage breaks in 1.8, so in order to get minitest-spec-rails and others working for 1.8 using the DSL module, we need a working #name method that does not return "dunno". This code illustrates how alias will not work in 1.8 for #name while the pull request works around this 1.8 oddity.

module DSL
  def to_s
    super
  end
  alias :name :to_s
end

class Bar
  extend DSL
end

puts Bar.to_s
puts Bar.name # dsl_fail.rb:3:in `name': super: no superclass method `to_s' for Bar:Class (NoMethodError)
              # from dsl_fail.rb:13

@ghost ghost assigned zenspider Mar 18, 2013

Owner

zenspider commented Mar 18, 2013

The duplicated code doesn't make sense to me. I did something in-between your patch and #248. I'll get that out shortly.

@zenspider zenspider closed this Mar 18, 2013

@zenspider zenspider added a commit that referenced this pull request Mar 18, 2013

@zenspider zenspider Fixed #248: Ensure spec names are correct and #251: Fix 1.8 DSL#name …
…bug. (blowmage and metaskills respectively)

[git-p4: depot-paths = "//src/minitest/dev/": change = 8299]
0b8ca17

@zenspider zenspider added a commit that referenced this pull request Apr 17, 2013

@zenspider zenspider Fixed #248: Ensure spec names are correct and #251: Fix 1.8 DSL#name …
…bug. (blowmage and metaskills respectively)

[git-p4: depot-paths = "//src/minitest/dev/": change = 8299]
55b342f

@zenspider zenspider locked and limited conversation to collaborators May 17, 2017

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.