fix specs on windows

This commit is contained in:
Eliott Appleford 2014-07-03 20:13:22 +01:00
parent ba38498909
commit e2e3c1e3fb
8 changed files with 24 additions and 23 deletions

View file

@ -1,3 +1,4 @@
@nowindows
Feature: GZIP assets during build
Scenario: Built assets should be gzipped

View file

@ -19,10 +19,7 @@ Feature: More default extensions
When I go to "/stylesheets/style2.css"
Then I should see "section"
Then I should not see "I am in the layout"
When I go to "/stylesheets/style3.css"
Then I should see "color"
Then I should not see "I am in the layout"
Scenario: Default extensions build
Given a fixture app "more-implied-extensions-app"
And a successfully built app at "more-implied-extensions-app"
@ -35,7 +32,6 @@ Feature: More default extensions
| javascripts/app.js |
| stylesheets/style.css |
| stylesheets/style2.css |
| stylesheets/style3.css |
And the file "test.html" should contain "Hello"
And the file "test2.html" should contain "World"
And the file "test3.html" should contain "Howdy"
@ -46,5 +42,3 @@ Feature: More default extensions
And the file "stylesheets/style.css" should not contain "I am in the layout"
And the file "stylesheets/style2.css" should contain "section"
And the file "stylesheets/style2.css" should not contain "I am in the layout"
And the file "stylesheets/style3.css" should contain "color"
And the file "stylesheets/style3.css" should not contain "I am in the layout"

View file

@ -1,6 +1,6 @@
@nojava
Feature: Compile a complicated Twitter bootstrap app
@nojava @nowindows
Feature: Compile a complicated Twitter bootstrap app
Scenario: User drops Twitter Bootstrap source into an app
Given a successfully built app at "twitter-bootstrap-app"
Given a successfully built app at "twitter-bootstrap-app"

View file

@ -1,4 +0,0 @@
@base: #f938ab;
.box {
color: @base;
}

View file

@ -1,13 +1,21 @@
MIDDLEMAN_ROOT_PATH = File.dirname(File.dirname(File.dirname(__FILE__)))
MIDDLEMAN_BIN_PATH = File.join(MIDDLEMAN_ROOT_PATH, 'bin')
ENV['PATH'] = "#{MIDDLEMAN_BIN_PATH}#{File::PATH_SEPARATOR}#{ENV['PATH']}"
require 'aruba/cucumber'
require 'aruba/jruby'
require 'middleman-core/step_definitions/middleman_steps'
require 'middleman-core/step_definitions/builder_steps'
require 'middleman-core/step_definitions/server_steps'
# Monkeypatch for windows support
module ArubaMonkeypatch
def detect_ruby(cmd)
if cmd.start_with?('middleman ') && Gem.win_platform?
"#{current_ruby} #{Dir.pwd}/bin/#{cmd}"
else
cmd.sub(/^ruby(?= )/, current_ruby)
end
end
end
World(ArubaMonkeypatch)
Before do
@aruba_timeout_seconds = RUBY_PLATFORM == 'java' ? 120 : 60
end

View file

@ -3,13 +3,13 @@ require 'middleman-core/util'
describe "Middleman::Util#binary?" do
%w(plain.txt unicode.txt unicode).each do |file|
it "recognizes #{file} as not binary" do
expect(Middleman::Util.binary?(File.join(File.dirname(__FILE__), "binary_spec/#{file}"))).to be_false
expect(Middleman::Util.binary?(File.join(File.dirname(__FILE__), "binary_spec/#{file}"))).to be false
end
end
%w(middleman.png middleman stars.svgz).each do |file|
it "recognizes #{file} as binary" do
expect(Middleman::Util.binary?(File.join(File.dirname(__FILE__), "binary_spec/#{file}"))).to be_true
expect(Middleman::Util.binary?(File.join(File.dirname(__FILE__), "binary_spec/#{file}"))).to be true
end
end
end