spec/integration_spec.rb in parallel_tests-0.11.3 vs spec/integration_spec.rb in parallel_tests-0.11.4
- old
+ new
@@ -1,5 +1,7 @@
+#encoding: utf-8
+
require 'spec_helper'
describe 'CLI' do
before do
`rm -rf #{folder}`
@@ -59,10 +61,17 @@
result.scan('2 examples, 0 failures').size.should == 1 # 1 summary
result.scan(/Finished in \d+\.\d+ seconds/).size.should == 2
result.scan(/Took \d+\.\d+ seconds/).size.should == 1 # parallel summary
end
+ it "runs tests which outputs accented characters" do
+ write "spec/xxx_spec.rb", "#encoding: utf-8\ndescribe('it'){it('should'){puts 'Byłem tu'}}"
+ result = run_tests "spec", :type => 'rspec'
+ # test ran and gave their puts
+ result.should include('Byłem tu')
+ end
+
it "does not run any tests if there are none" do
write 'spec/xxx_spec.rb', '1'
result = run_tests "spec", :type => 'rspec'
result.should include('No examples found')
result.should include('Took')
@@ -219,9 +228,16 @@
before do
write "features/steps/a.rb", "
Given('I print TEST_ENV_NUMBER'){ puts \"YOUR TEST ENV IS \#{ENV['TEST_ENV_NUMBER']}!\" }
And('I sleep a bit'){ sleep 0.2 }
"
+ end
+
+ it "runs tests which outputs accented characters" do
+ write "features/good1.feature", "Feature: xxx\n Scenario: xxx\n Given I print accented characters"
+ write "features/steps/a.rb", "#encoding: utf-8\nGiven('I print accented characters'){ puts \"I tu też\" }"
+ result = run_tests "features", :type => "cucumber", :add => '--pattern good'
+ result.should include('I tu też')
end
it "passes TEST_ENV_NUMBER when running with pattern (issue #86)" do
write "features/good1.feature", "Feature: xxx\n Scenario: xxx\n Given I print TEST_ENV_NUMBER"
write "features/good2.feature", "Feature: xxx\n Scenario: xxx\n Given I print TEST_ENV_NUMBER"