context/should not support Rails 5 run single test example with a line number.
zw963 opened this issue · comments
Billy.Zheng commented
Rails add new function which can run test included the line number.
/test/jobs/bid_goods_item_expired_job_test.rb:13
But this not worked if use like following:
class CalculatorTest < Test::Unit::TestCase
context "a calculator" do
setup do
@calculator = Calculator.new
end
should "add two numbers for the sum" do
assert_equal 4, @calculator.sum(2, 2)
end
should "multiply two numbers for the product" do
assert_equal 10, @calculator.product(2, 5)
end
end
end
Rails 5.0.0
shoulda (3.5.0)
shoulda-context (~> 1.0, >= 1.0.1)
shoulda-matchers (>= 1.4.1, < 3.0)
shoulda-context (1.2.1)
shoulda-matchers (2.8.0)
shoulda (> 3.5)> 2.0)
shoulda-matchers (
bundle config:
group :test do
gem 'shoulda', '~> 3.5'
gem 'shoulda-matchers', '~> 2.0'
end
Billy.Zheng commented
Current Rails 5.0.2.
shoulda version:
╰─ $ cat Gemfile.lock |grep shoulda
shoulda (3.5.0)
shoulda-context (~> 1.0, >= 1.0.1)
shoulda-matchers (>= 1.4.1, < 3.0)
shoulda-context (1.2.2)
shoulda-matchers (2.8.0)
shoulda
shoulda-matchers
Seem like if number aligned or within a should
block is worked!
But, if number aligned with a `context', it not worked.
Richard Macklin commented
For future readers, this issue was fixed in shoulda-context v1.2.2, via #51
Billy.Zheng commented
Current no condition to test this, anyway, thanks.