New issue

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

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix tests to run on minitest > 5 #1606

Merged
merged 4 commits into from Feb 26, 2014

Conversation

Projects
None yet
2 participants
@ujifgc
Member

ujifgc commented Feb 25, 2014

No description provided.

@ujifgc ujifgc added the test label Feb 25, 2014

@dariocravero

This comment has been minimized.

Show comment
Hide comment
@dariocravero

dariocravero Feb 26, 2014

Contributor

Great work @ujifgc! Thanks for this.

However, I'm getting some errors while running the tests, they are all related to except being missing on Hash:

  1) Error:
FormBuilder::for #form_for method#test_0006_display correct form html with namespace option:
NoMethodError: undefined method `except' for {:namespace=>"foo"}:Hash
    /Users/daris/UXtemple/opensource/padrino-framework/padrino-helpers/lib/padrino-helpers/form_helpers.rb:45:in `form_for'
    /Users/daris/UXtemple/opensource/padrino-framework/padrino-helpers/test/test_form_builder.rb:64:in `block (3 levels) in <top (required)>'

  2) Error:
FormBuilder::for #form_for method#test_0002_display correct form html with fake object:
NoMethodError: undefined method `except' for {:id=>"register", :"accept-charset"=>"UTF-8", :method=>"post"}:Hash
    /Users/daris/UXtemple/opensource/padrino-framework/padrino-helpers/lib/padrino-helpers/form_helpers.rb:45:in `form_for'
    /Users/daris/UXtemple/opensource/padrino-framework/padrino-helpers/test/test_form_builder.rb:39:in `block (3 levels) in <top (required)>'


  3) Error:
FormBuilder::for #form_for method#test_0009_display correct form html with method :put:
NoMethodError: undefined method `except' for {:"accept-charset"=>"UTF-8", :method=>"put"}:Hash
    /Users/daris/UXtemple/opensource/padrino-framework/padrino-helpers/lib/padrino-helpers/form_helpers.rb:45:in `form_for'
    /Users/daris/UXtemple/opensource/padrino-framework/padrino-helpers/test/test_form_builder.rb:90:in `block (3 levels) in <top (required)>'


  4) Error:
FormBuilder::for #form_for method#test_0010_display correct form html with method :delete:
NoMethodError: undefined method `except' for {:"accept-charset"=>"UTF-8", :method=>"delete"}:Hash
    /Users/daris/UXtemple/opensource/padrino-framework/padrino-helpers/lib/padrino-helpers/form_helpers.rb:45:in `form_for'
    /Users/daris/UXtemple/opensource/padrino-framework/padrino-helpers/test/test_form_builder.rb:96:in `block (3 levels) in <top (required)>'

Other than that it seems to be just fine. I don't get those errors in master without this patch. It's weird that Travis didn't pick it up. @padrino/core-members?

Contributor

dariocravero commented Feb 26, 2014

Great work @ujifgc! Thanks for this.

However, I'm getting some errors while running the tests, they are all related to except being missing on Hash:

  1) Error:
FormBuilder::for #form_for method#test_0006_display correct form html with namespace option:
NoMethodError: undefined method `except' for {:namespace=>"foo"}:Hash
    /Users/daris/UXtemple/opensource/padrino-framework/padrino-helpers/lib/padrino-helpers/form_helpers.rb:45:in `form_for'
    /Users/daris/UXtemple/opensource/padrino-framework/padrino-helpers/test/test_form_builder.rb:64:in `block (3 levels) in <top (required)>'

  2) Error:
FormBuilder::for #form_for method#test_0002_display correct form html with fake object:
NoMethodError: undefined method `except' for {:id=>"register", :"accept-charset"=>"UTF-8", :method=>"post"}:Hash
    /Users/daris/UXtemple/opensource/padrino-framework/padrino-helpers/lib/padrino-helpers/form_helpers.rb:45:in `form_for'
    /Users/daris/UXtemple/opensource/padrino-framework/padrino-helpers/test/test_form_builder.rb:39:in `block (3 levels) in <top (required)>'


  3) Error:
FormBuilder::for #form_for method#test_0009_display correct form html with method :put:
NoMethodError: undefined method `except' for {:"accept-charset"=>"UTF-8", :method=>"put"}:Hash
    /Users/daris/UXtemple/opensource/padrino-framework/padrino-helpers/lib/padrino-helpers/form_helpers.rb:45:in `form_for'
    /Users/daris/UXtemple/opensource/padrino-framework/padrino-helpers/test/test_form_builder.rb:90:in `block (3 levels) in <top (required)>'


  4) Error:
FormBuilder::for #form_for method#test_0010_display correct form html with method :delete:
NoMethodError: undefined method `except' for {:"accept-charset"=>"UTF-8", :method=>"delete"}:Hash
    /Users/daris/UXtemple/opensource/padrino-framework/padrino-helpers/lib/padrino-helpers/form_helpers.rb:45:in `form_for'
    /Users/daris/UXtemple/opensource/padrino-framework/padrino-helpers/test/test_form_builder.rb:96:in `block (3 levels) in <top (required)>'

Other than that it seems to be just fine. I don't get those errors in master without this patch. It's weird that Travis didn't pick it up. @padrino/core-members?

@ujifgc

This comment has been minimized.

Show comment
Hide comment
@ujifgc

ujifgc Feb 26, 2014

Member

require 'active_support/core_ext/hash/except' should fix it.

Member

ujifgc commented Feb 26, 2014

require 'active_support/core_ext/hash/except' should fix it.

@ujifgc

This comment has been minimized.

Show comment
Hide comment
@ujifgc

ujifgc Feb 26, 2014

Member

@dariocravero is this error stable on your box? Can you show your Gemfile.lock?

Member

ujifgc commented Feb 26, 2014

@dariocravero is this error stable on your box? Can you show your Gemfile.lock?

@dariocravero

This comment has been minimized.

Show comment
Hide comment
@dariocravero

dariocravero Feb 26, 2014

Contributor

Yeah, that fixes it.

Here's my Gemfile.lock:

padrino-framework [as41*] $ cat Gemfile.lock
PATH
  remote: padrino
  specs:
    padrino (0.12.0)
      padrino-admin (= 0.12.0)
      padrino-cache (= 0.12.0)
      padrino-core (= 0.12.0)
      padrino-gen (= 0.12.0)
      padrino-helpers (= 0.12.0)
      padrino-mailer (= 0.12.0)

PATH
  remote: padrino-admin
  specs:
    padrino-admin (0.12.0)
      padrino-core (= 0.12.0)
      padrino-helpers (= 0.12.0)

PATH
  remote: padrino-cache
  specs:
    padrino-cache (0.12.0)
      moneta (~> 0.7.0)
      padrino-core (= 0.12.0)
      padrino-helpers (= 0.12.0)

PATH
  remote: padrino-core
  specs:
    padrino-core (0.12.0)
      activesupport (>= 3.1)
      http_router (~> 0.11.0)
      rack-protection (>= 1.5.0)
      sinatra (~> 1.4.2)
      thor (~> 0.18.0)
      tilt (~> 1.4.1)

PATH
  remote: padrino-gen
  specs:
    padrino-gen (0.12.0)
      bundler (~> 1.0)
      padrino-core (= 0.12.0)

PATH
  remote: padrino-helpers
  specs:
    padrino-helpers (0.12.0)
      i18n (~> 0.6, >= 0.6.7)
      padrino-core (= 0.12.0)

PATH
  remote: padrino-mailer
  specs:
    padrino-mailer (0.12.0)
      mail (~> 2.5.3)
      padrino-core (= 0.12.0)

GEM
  remote: https://rubygems.org/
  specs:
    activesupport (3.2.17)
      i18n (~> 0.6, >= 0.6.4)
      multi_json (~> 1.0)
    addressable (2.3.5)
    builder (3.2.2)
    data_objects (0.10.14)
      addressable (~> 2.1)
    dm-aggregates (1.2.0)
      dm-core (~> 1.2.0)
    dm-core (1.2.1)
      addressable (~> 2.3)
    dm-do-adapter (1.2.0)
      data_objects (~> 0.10.6)
      dm-core (~> 1.2.0)
    dm-migrations (1.2.0)
      dm-core (~> 1.2.0)
    dm-sqlite-adapter (1.2.0)
      dm-do-adapter (~> 1.2.0)
      do_sqlite3 (~> 0.10.6)
    dm-validations (1.2.0)
      dm-core (~> 1.2.0)
    do_sqlite3 (0.10.14)
      data_objects (= 0.10.14)
    erubis (2.7.0)
    fakeweb (1.3.0)
    haml (4.0.5)
      tilt
    http_router (0.11.1)
      rack (>= 1.0.0)
      url_mount (~> 0.2.1)
    i18n (0.6.9)
    mail (2.5.4)
      mime-types (~> 1.16)
      treetop (~> 1.4.8)
    metaclass (0.0.4)
    mime-types (1.25.1)
    minitest (4.7.5)
    mocha (1.0.0)
      metaclass (~> 0.0.1)
    moneta (0.7.20)
    multi_json (1.8.4)
    nokogiri (1.5.11)
    polyglot (0.3.4)
    rack (1.5.2)
    rack-protection (1.5.2)
      rack
    rack-test (0.6.2)
      rack (>= 1.0)
    rake (10.1.1)
    sinatra (1.4.4)
      rack (~> 1.4)
      rack-protection (~> 1.4)
      tilt (~> 1.3, >= 1.3.4)
    slim (2.0.2)
      temple (~> 0.6.6)
      tilt (>= 1.3.3, < 2.1)
    temple (0.6.7)
    thor (0.18.1)
    tilt (1.4.1)
    treetop (1.4.15)
      polyglot
      polyglot (>= 0.3.1)
    url_mount (0.2.1)
      rack
    webrat (0.7.3)
      nokogiri (>= 1.2.0)
      rack (>= 1.0)
      rack-test (>= 0.5.3)
    yard (0.8.7.3)

PLATFORMS
  ruby

DEPENDENCIES
  builder (>= 2.1.2)
  dm-aggregates (>= 1.2)
  dm-core (>= 1.2)
  dm-migrations (>= 1.2)
  dm-sqlite-adapter (>= 1.2)
  dm-validations (>= 1.2)
  erubis (>= 2.7.0)
  fakeweb (>= 1.2.8)
  haml (>= 2.2.22)
  jruby-openssl
  minitest (>= 4.0)
  mocha (>= 0.10.0)
  nokogiri (~> 1.5.10)
  padrino!
  padrino-admin!
  padrino-cache!
  padrino-core!
  padrino-gen!
  padrino-helpers!
  padrino-mailer!
  rack (>= 1.3.0)
  rack-test (>= 0.5.0)
  rake (>= 0.8.7)
  slim (>= 1.3.0)
  webrat (>= 0.5.1)
  yard (>= 0.7.2)
Contributor

dariocravero commented Feb 26, 2014

Yeah, that fixes it.

Here's my Gemfile.lock:

padrino-framework [as41*] $ cat Gemfile.lock
PATH
  remote: padrino
  specs:
    padrino (0.12.0)
      padrino-admin (= 0.12.0)
      padrino-cache (= 0.12.0)
      padrino-core (= 0.12.0)
      padrino-gen (= 0.12.0)
      padrino-helpers (= 0.12.0)
      padrino-mailer (= 0.12.0)

PATH
  remote: padrino-admin
  specs:
    padrino-admin (0.12.0)
      padrino-core (= 0.12.0)
      padrino-helpers (= 0.12.0)

PATH
  remote: padrino-cache
  specs:
    padrino-cache (0.12.0)
      moneta (~> 0.7.0)
      padrino-core (= 0.12.0)
      padrino-helpers (= 0.12.0)

PATH
  remote: padrino-core
  specs:
    padrino-core (0.12.0)
      activesupport (>= 3.1)
      http_router (~> 0.11.0)
      rack-protection (>= 1.5.0)
      sinatra (~> 1.4.2)
      thor (~> 0.18.0)
      tilt (~> 1.4.1)

PATH
  remote: padrino-gen
  specs:
    padrino-gen (0.12.0)
      bundler (~> 1.0)
      padrino-core (= 0.12.0)

PATH
  remote: padrino-helpers
  specs:
    padrino-helpers (0.12.0)
      i18n (~> 0.6, >= 0.6.7)
      padrino-core (= 0.12.0)

PATH
  remote: padrino-mailer
  specs:
    padrino-mailer (0.12.0)
      mail (~> 2.5.3)
      padrino-core (= 0.12.0)

GEM
  remote: https://rubygems.org/
  specs:
    activesupport (3.2.17)
      i18n (~> 0.6, >= 0.6.4)
      multi_json (~> 1.0)
    addressable (2.3.5)
    builder (3.2.2)
    data_objects (0.10.14)
      addressable (~> 2.1)
    dm-aggregates (1.2.0)
      dm-core (~> 1.2.0)
    dm-core (1.2.1)
      addressable (~> 2.3)
    dm-do-adapter (1.2.0)
      data_objects (~> 0.10.6)
      dm-core (~> 1.2.0)
    dm-migrations (1.2.0)
      dm-core (~> 1.2.0)
    dm-sqlite-adapter (1.2.0)
      dm-do-adapter (~> 1.2.0)
      do_sqlite3 (~> 0.10.6)
    dm-validations (1.2.0)
      dm-core (~> 1.2.0)
    do_sqlite3 (0.10.14)
      data_objects (= 0.10.14)
    erubis (2.7.0)
    fakeweb (1.3.0)
    haml (4.0.5)
      tilt
    http_router (0.11.1)
      rack (>= 1.0.0)
      url_mount (~> 0.2.1)
    i18n (0.6.9)
    mail (2.5.4)
      mime-types (~> 1.16)
      treetop (~> 1.4.8)
    metaclass (0.0.4)
    mime-types (1.25.1)
    minitest (4.7.5)
    mocha (1.0.0)
      metaclass (~> 0.0.1)
    moneta (0.7.20)
    multi_json (1.8.4)
    nokogiri (1.5.11)
    polyglot (0.3.4)
    rack (1.5.2)
    rack-protection (1.5.2)
      rack
    rack-test (0.6.2)
      rack (>= 1.0)
    rake (10.1.1)
    sinatra (1.4.4)
      rack (~> 1.4)
      rack-protection (~> 1.4)
      tilt (~> 1.3, >= 1.3.4)
    slim (2.0.2)
      temple (~> 0.6.6)
      tilt (>= 1.3.3, < 2.1)
    temple (0.6.7)
    thor (0.18.1)
    tilt (1.4.1)
    treetop (1.4.15)
      polyglot
      polyglot (>= 0.3.1)
    url_mount (0.2.1)
      rack
    webrat (0.7.3)
      nokogiri (>= 1.2.0)
      rack (>= 1.0)
      rack-test (>= 0.5.3)
    yard (0.8.7.3)

PLATFORMS
  ruby

DEPENDENCIES
  builder (>= 2.1.2)
  dm-aggregates (>= 1.2)
  dm-core (>= 1.2)
  dm-migrations (>= 1.2)
  dm-sqlite-adapter (>= 1.2)
  dm-validations (>= 1.2)
  erubis (>= 2.7.0)
  fakeweb (>= 1.2.8)
  haml (>= 2.2.22)
  jruby-openssl
  minitest (>= 4.0)
  mocha (>= 0.10.0)
  nokogiri (~> 1.5.10)
  padrino!
  padrino-admin!
  padrino-cache!
  padrino-core!
  padrino-gen!
  padrino-helpers!
  padrino-mailer!
  rack (>= 1.3.0)
  rack-test (>= 0.5.0)
  rake (>= 0.8.7)
  slim (>= 1.3.0)
  webrat (>= 0.5.1)
  yard (>= 0.7.2)
@ujifgc

This comment has been minimized.

Show comment
Hide comment
@ujifgc

ujifgc Feb 26, 2014

Member

It was using 'i18n/core_ext/hash#except'.

Member

ujifgc commented Feb 26, 2014

It was using 'i18n/core_ext/hash#except'.

@dariocravero

This comment has been minimized.

Show comment
Hide comment
@dariocravero

dariocravero Feb 26, 2014

Contributor

Alright, so we should be adding the require to the helper, right? Unless you have any other suggestions...

Contributor

dariocravero commented Feb 26, 2014

Alright, so we should be adding the require to the helper, right? Unless you have any other suggestions...

@ujifgc

This comment has been minimized.

Show comment
Hide comment
@ujifgc

ujifgc Feb 26, 2014

Member

I fixed it a4ec2d5 already. Does it work?

Member

ujifgc commented Feb 26, 2014

I fixed it a4ec2d5 already. Does it work?

@dariocravero

This comment has been minimized.

Show comment
Hide comment
@dariocravero

dariocravero Feb 26, 2014

Contributor

That's perfect @ujifgc! Merged.

Contributor

dariocravero commented Feb 26, 2014

That's perfect @ujifgc! Merged.

dariocravero added a commit that referenced this pull request Feb 26, 2014

Merge pull request #1606 from padrino/as41
fix tests to run on minitest > 5

@dariocravero dariocravero merged commit 79dae74 into master Feb 26, 2014

1 check passed

default The Travis CI build passed
Details

@ujifgc ujifgc deleted the as41 branch Feb 26, 2014

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