README.md in ass_tests-1.0.0.alpha vs README.md in ass_tests-1.2.0.alpha

- old
+ new

@@ -17,23 +17,21 @@ ## Trouble - Works only in Windows or Cygwin. - Not available methods ```eval``` and ```execute``` of 1C "Global context" - Unpossible attach to 1C debugger. -- Now support ```Minitest::Test``` only +- Now support ```Minitest``` only +- `AssTests::Assertions` works for external or thick application ole connectors only - Other unknown now :( ## Features - Provides DSL for describe 1C:Enterprise application (aka "Information base") - Support to describe many different 1C Information bases. - Support describe exists Information bases as ```external```. Such Information bases is persistent and can't be build or remove. - Automatically build described Information base on demand. -- Automatically rebuild Information base on demand. -- Passes required instance of class `InfoBase` into tests for connect to Information base for testing. -- Hold pool of opened connection with 1C information bases for decrease costs on wakeup 1C application. -- Automatically close all opened connection after all tests executed. +- Automatically close all opened connection after all tests executed. It provides `AssOle::Runtimes` - Provides assertions for tests 1C values in Ruby side - Provides features for testing of 1C externals like as ExternalDataProcessor and ExternalReport - Provides features for fill data in infobases under test. ## Installation @@ -57,70 +55,79 @@ ### Smal example for ```Minitest``` - ```test_helper.rb```: ```ruby -require 'ass_tests/autorun' -require 'ass_tests/info_bases' - # Describe empty InfoBase + +require 'ass_tests/minitest' AssTests::InfoBases.describe do file :empty_ib end + +module ExampleTest + # Describe runtimes + module Runtimes + module Ext + is_ole_runtime :external + run AssTests::InfoBases[:empty_ib] + end + + module ThickApp + is_ole_runtime :thick + run AssTests::InfoBases[:empty_ib] + end + end +end + +# After all was prepared loads autorun +require 'ass_tests/minitest/autorun' ``` -- ```small_test.rb```: +- ```exmple_test.rb```: ```ruby +module ExampleTest + describe 'Spec examle' do + like_ole_runtime Runtimes::Ext + include AssTests::Assertions -class SmalTest < AssTests::MiniTest::Test - # Demands described :empty_ib information base - use :empty_ib - # Declare to run :empty_ib in :context of :thick application - # and we ask keep alive connection while tests executing - # Default :keep_alive => true. - # If set :keep_alive => false for :thick or :thin context - # wakeup connection will be very slowly for big applications - context :thick, :keep_alive => true - # If we want login in information base as some user we say: - # login :as => 'user', :with => 'password' - # In this example we use empty information base without any users + it 'Call runtime #metaData' do + _assert_equal metaData, metaData + end + end - # If we say :keep_alive => true and in tests we want to manipulate - # with data, each test mast be wrapped in 1C transaction - # for tests isolation. - # In this example we aren't manipulate with data - # Warning! 1C transaction not define for :thin context, - # for :thin context require patch information base application - def setup - ole.BeginTransaction + class TestExample < Minitest::Test + like_ole_runtime Runtimes::Ext + include AssTests::Assertions + + def test_runtime_metaData + _assert_equal metaData, metaData + end end - # Transaction mast be rollback for tests isolation - def teardown - ole.RollbackTransaction + # Shared tests + module SharedTests + def test_runtime_metaData + _assert_equal metaData, metaData + end end - puts infobase.name # => "empty_ib" - puts infobase.exists? # => "true" - puts ole.__opened__? # => "false" - puts ole.class # => "AssLauncher::Enterprise::Ole::ThickApplication" - - def test_hello_world - puts ole.__opened__? # => "true" - a = ole.newObject 'array' - a.add 'Hello world' - assert_equal 'Hello world', ole.string(a.get(0)) + class TestInExternalRuntime < Minitest::Test + like_ole_runtime Runtimes::Ext + include AssTests::Assertions + include SharedTests end - def test_other - assert ole.__opened__? + class TestInThickAppRuntime < Minitest::Test + like_ole_runtime Runtimes::ThickApp + include AssTests::Assertions + include SharedTests end end + ``` - also you can write native ```Minitest::Test``` for testing other things like this ```ordinary_test.rb```: ```ruby -# Also you can write native Minitest::Test - class OrdinaryTest < Minitest::Test def test_fail assert false end end