Sha256: 0865b516340d0fe611aca5db2ea61cf397af9a2b1f7f1be76687a79ad0e0fcb6

Contents?: true

Size: 1.26 KB

Versions: 6

Compression:

Stored size: 1.26 KB

Contents

require File.expand_path(File.dirname(__FILE__) + '/spec_helper')

describe Butternut do
  describe "running a scenario" do
    extend SpecHelperDsl
    include SpecHelper

    describe "saving last page info" do
      define_steps do
        Given('waffles') do
          visit("file://" + File.expand_path(File.dirname(__FILE__) + "/fixtures/foo.html"))
        end
        AfterStep do |scenario|
          begin
            scenario.last_page_source.should match(/Foo/)
            scenario.last_page_url.should match(/foo\.html/)
          rescue Exception => e
            p e
          end
        end
      end

      define_feature <<-FEATURE
        Scenario: Roffle waffles
          Given waffles
      FEATURE

      it { run_defined_feature }
    end

    describe "resetting page_changed" do
      define_steps do
        Given('waffles') do
          visit("file://" + File.expand_path(File.dirname(__FILE__) + "/fixtures/foo.txt"))
        end
        AfterStep do |scenario|
          begin
            page_changed?.should be_false
          rescue Exception => e
            p e
          end
        end
      end

      define_feature <<-FEATURE
        Scenario: Roffle waffles
          Given waffles
      FEATURE

      it { run_defined_feature }
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
butternut-0.2.2-java spec/butternut_spec.rb
butternut-0.2.1 spec/butternut_spec.rb
butternut-0.2.0 spec/butternut_spec.rb
butternut-0.1.0 spec/butternut_spec.rb
butternut-0.0.1 spec/butternut_spec.rb
butternut-0.0.0 spec/butternut_spec.rb