 MychaConfiguration = require '../lib/mycha_configuration'
 
 
+# Helper method to create MychaConfiguration instances in tests.
+create_mycha_configuration = (run_options = {})->
+  new MychaConfiguration
+    run_options: run_options
+    default_mycha_options: Mycha.default_mycha_options
+
+
 describe 'MychaConfiguration', ->
 
   describe 'constructor', ->

          reporter: 'custom reporter'
          testDir: 'test/test_data'
          foo: 'bar'
        @mycha_configuration = new MychaConfiguration
          run_options: @user_options
          default_mycha_options: Mycha.default_mycha_options
          files: []

      it 'uses the custom stdout', ->
        expect(@mycha_configuration.options.stdout).to.equal 'custom stdout'

    context 'without user options', ->

      beforeEach ->
        mycha_configuration = create_mycha_configuration()
        @result = mycha_configuration.merge_options {},
                                                    Mycha.default_mycha_options

