[jruby] unsuccesful migration- file contains fails

5 views
Skip to first unread message

r.gro...@gmail.com

unread,
Nov 29, 2016, 7:21:44 PM11/29/16
to Cukes
hello group.

I have a ruby project that is currently based on jruby1.6.8.
I wanted to know if I can use jruby9.0.5.0 as well.
I needed to change some code to get it working. The rspec tests run successfully, but I keep running in Cucumber test issues.

My first problem was that the feature files are latin1 encoded, because the input to the tested methods is latin1 encode.
For one of the feature files, I changed to utf-8 (which I rather don't), but after that lots of test fail because the 'file contains' test reports an error.

the failing line says
        And  the XML file should match "<details>"

Which triggers this code

Then /^the (input|XML|fo|ubl)(?: file)? should (not )?contain (#{CAPT_DQS}|#{CAPT_SQS})$/ do
|soort, niet, string|
    file = case soort
                when 'input' then @input_generated
                when 'XML' then @xml_generated
                when 'fo' then @fo_generated
                else @ubl_generated
            end
    if niet != 'not '
        verbose( "loc1", 4)
        expect(file).to have_file_content('<details>')
    else
        verbose( "loc2", 4)
        expect(file).not_to have_file_content(string)
    end
    #check_file_content( file, string, (niet != 'not '))
end


I have changed the check_file_content line to expect statements. Both are failing in the test:

    And the XML file should contain "<details>"
      expected "/home/rdgon/project/vistafactuur/test/tmp/aruba/input.txt.xtmp" to have file content: "<details>" (RSpec::Expectations::ExpectationNotMetError)
      ./features/step_definition/test_steps.rb:144:in `/^the (input|XML|fo|ubl)(?: file)? should (not )?contain ("(?:(?:\"|[^\"])*)"|'(?:(?:\'|[^])*)')$/'
      features/vistabrief_txt.feature:80:in `And the XML file should contain "<details>"'


The point is that the string ('<details>') is contained in the test file:
.......
         <alinea>Hierbij heten wij u van harte welkom als abonnee van de volgende uitgave(n):</alinea>
         <details>
            <uitgave>
               <titel>test title</titel>
               <code>Code1</code>
               <aantal>1</aantal>
........


Changing
And  the XML file should contain "<details>"
to
And  the XML file should match /<details>/
has as effect that the test will not fail anymore.

Who can explain me why this is happening and maybe what I can do to resolve this. Is this an aruba bug?

Thanks in advance, Ruud

my gem list is
aruba (0.14.2, 0.7.4, 0.6.1)
builder (3.2.2)
bundler (1.13.6)
bundler-unload (1.0.2)
childprocess (0.5.9, 0.5.5)
contracts (0.14.0)
cucumber (2.4.0, 1.2.5)
cucumber-core (1.5.0)
cucumber-wire (0.0.1)
diff-lcs (1.2.5)
executable-hooks (1.3.2)
ffi (1.9.14 java, 1.9.6 java)
gem-wrappers (1.2.7)
gherkin (4.0.0, 2.11.8 java)
jar-dependencies (0.2.3)
jruby-launcher (1.1.1 java)
jruby-openssl (0.9.18 java, 0.9.15 java, 0.9.5 java)
json (1.8.0 java)
minitest (5.9.1, 5.4.1)
multi_json (1.12.1, 1.10.1)
multi_test (0.1.2)
power_assert (0.2.3)
psych (2.0.15 java)
racc (1.4.13 java)
rack (1.6.5, 1.5.2)
rack-protection (1.5.3)
rake (11.3.0, 10.1.0)
rdoc (4.1.2)
rspec (3.5.0, 3.1.0)
rspec-core (3.5.4, 3.1.7)
rspec-expectations (3.5.0, 3.1.2)
rspec-mocks (3.5.0, 3.1.3)
rspec-support (3.5.0, 3.1.2)
rubygems-bundler (1.4.4)
rvm (1.11.3.9)
sinatra (1.4.2)
test-unit (3.0.3)
thor (0.19.1)
tilt (1.4.1)


Reply all
Reply to author
Forward
0 new messages